pub struct CollectionName { /* private fields */ }
Expand description
Represents the fully-qualified path of a collection.
Implementations§
Source§impl CollectionName
impl CollectionName
Sourcepub fn new(project_id: &str, collection: &str) -> Self
pub fn new(project_id: &str, collection: &str) -> Self
Construct a CollectionName
for a top-level collection, i.e. a direct descendent of the root.
Equivalent to new_with_path
with an empty path
.
Sourcepub fn new_with_path(
project_id: &str,
path: &[(&str, &str)],
collection: &str,
) -> Self
pub fn new_with_path( project_id: &str, path: &[(&str, &str)], collection: &str, ) -> Self
Construct a CollectionName
nested under a document.
pub fn subcollection(&self, name: &str, collection: &str) -> CollectionName
Sourcepub fn parent(&self) -> ParentDocumentOrRoot
pub fn parent(&self) -> ParentDocumentOrRoot
Return a representation of the parent of this collection, which may either be a document or the root.
Sourcepub fn parent_collection(&self) -> Option<Self>
pub fn parent_collection(&self) -> Option<Self>
Return the collection of the document that this collection is nested under, if it exists.
If this collection is directly under the root, returns None
.
Sourcepub fn document(&self, name: &str) -> DocumentName
pub fn document(&self, name: &str) -> DocumentName
Return a reference to a named document directly under this collection.
Trait Implementations§
Source§impl Clone for CollectionName
impl Clone for CollectionName
Source§fn clone(&self) -> CollectionName
fn clone(&self) -> CollectionName
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CollectionName
impl Debug for CollectionName
Source§impl Hash for CollectionName
impl Hash for CollectionName
Source§impl PartialEq for CollectionName
impl PartialEq for CollectionName
impl Eq for CollectionName
impl StructuralPartialEq for CollectionName
Auto Trait Implementations§
impl Freeze for CollectionName
impl RefUnwindSafe for CollectionName
impl Send for CollectionName
impl Sync for CollectionName
impl Unpin for CollectionName
impl UnwindSafe for CollectionName
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Wrap the input message
T
in a tonic::Request
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>
Wrap the input message
T
in a tonic::Request