Struct firestore_path::CollectionId
source · pub struct CollectionId(/* private fields */);
Expand description
A collection id.
Limit
https://firebase.google.com/docs/firestore/quotas#collections_documents_and_fields
- Must be valid UTF-8 characters
- Must be no longer than 1,500 bytes
- Cannot contain a forward slash (/)
- Cannot solely consist of a single period (.) or double periods (..)
- Cannot match the regular expression .*
Examples
use firestore_path::CollectionId;
use std::str::FromStr;
let collection_id = CollectionId::from_str("chatrooms")?;
assert_eq!(collection_id.as_ref(), "chatrooms");
assert_eq!(collection_id.to_string(), "chatrooms");
Trait Implementations§
source§impl AsRef<str> for CollectionId
impl AsRef<str> for CollectionId
source§impl Clone for CollectionId
impl Clone for CollectionId
source§fn clone(&self) -> CollectionId
fn clone(&self) -> CollectionId
Returns a copy 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 CollectionId
impl Debug for CollectionId
source§impl Display for CollectionId
impl Display for CollectionId
source§impl From<CollectionName> for CollectionId
impl From<CollectionName> for CollectionId
source§fn from(collection_name: CollectionName) -> Self
fn from(collection_name: CollectionName) -> Self
Converts to this type from the input type.
source§impl From<CollectionPath> for CollectionId
impl From<CollectionPath> for CollectionId
source§fn from(collection_path: CollectionPath) -> Self
fn from(collection_path: CollectionPath) -> Self
Converts to this type from the input type.
source§impl FromStr for CollectionId
impl FromStr for CollectionId
source§impl Hash for CollectionId
impl Hash for CollectionId
source§impl Ord for CollectionId
impl Ord for CollectionId
source§fn cmp(&self, other: &CollectionId) -> Ordering
fn cmp(&self, other: &CollectionId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for CollectionId
impl PartialEq for CollectionId
source§fn eq(&self, other: &CollectionId) -> bool
fn eq(&self, other: &CollectionId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CollectionId
impl PartialOrd for CollectionId
source§fn partial_cmp(&self, other: &CollectionId) -> Option<Ordering>
fn partial_cmp(&self, other: &CollectionId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<&str> for CollectionId
impl TryFrom<&str> for CollectionId
source§impl TryFrom<String> for CollectionId
impl TryFrom<String> for CollectionId
impl Eq for CollectionId
impl StructuralEq for CollectionId
impl StructuralPartialEq for CollectionId
Auto Trait Implementations§
impl RefUnwindSafe for CollectionId
impl Send for CollectionId
impl Sync for CollectionId
impl Unpin for CollectionId
impl UnwindSafe for CollectionId
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