pub struct Index {
pub name: String,
pub query_scope: i32,
pub fields: Vec<IndexField>,
pub state: i32,
}
Expand description
Cloud Firestore indexes enable simple and complex queries against documents in a database.
Fields§
§name: String
Output only. A server defined name for this index.
The form of this name for composite indexes will be:
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}
For single field indexes, this field will be empty.
query_scope: i32
Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id.
Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.
fields: Vec<IndexField>
The fields supported by this index.
For composite indexes, this is always 2 or more fields.
The last field entry is always for the field path __name__
. If, on
creation, __name__
was not specified as the last field, it will be added
automatically with the same direction as that of the last field defined. If
the final field in a composite index is not directional, the __name__
will be ordered ASCENDING (unless explicitly specified).
For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.
state: i32
Output only. The serving state of the index.
Implementations§
source§impl Index
impl Index
sourcepub fn query_scope(&self) -> QueryScope
pub fn query_scope(&self) -> QueryScope
Returns the enum value of query_scope
, or the default if the field is set to an invalid enum value.
sourcepub fn set_query_scope(&mut self, value: QueryScope)
pub fn set_query_scope(&mut self, value: QueryScope)
Sets query_scope
to the provided enum value.
Trait Implementations§
source§impl Message for Index
impl Message for Index
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Index
impl PartialEq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request