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 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 CollectionId
impl Debug for CollectionId
Source§impl Display for CollectionId
impl Display for CollectionId
Source§impl From<CollectionId> for CollectionPath
impl From<CollectionId> for CollectionPath
Source§fn from(collection_id: CollectionId) -> Self
fn from(collection_id: CollectionId) -> Self
Converts to this type from the input type.
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§impl PartialOrd for CollectionId
impl PartialOrd for CollectionId
Source§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 StructuralPartialEq for CollectionId
Auto Trait Implementations§
impl Freeze for CollectionId
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