Enum bonsaidb_core::schema::NamedReference
source · [−]Expand description
A reference to a collection that has a unique name view.
Variants
Name(Cow<'a, str>)
An entity’s name.
Id(u64)
A document id.
Implementations
Converts this reference to an owned reference with a 'static lifetime.
pub async fn id<Col: NamedCollection, Cn: Connection>(
&self,
connection: &Cn
) -> Result<Option<u64>, Error>
pub async fn id<Col: NamedCollection, Cn: Connection>(
&self,
connection: &Cn
) -> Result<Option<u64>, Error>
Returns this reference’s id. If the reference is a name, the
NamedCollection::ByNameView is queried for the id.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
impl<'a, 'c, C> From<&'c CollectionDocument<C>> for NamedReference<'a> where
C: SerializedCollection,
impl<'a, 'c, C> From<&'c CollectionDocument<C>> for NamedReference<'a> where
C: SerializedCollection,
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl<'a> RefUnwindSafe for NamedReference<'a>
impl<'a> Send for NamedReference<'a>
impl<'a> Sync for NamedReference<'a>
impl<'a> Unpin for NamedReference<'a>
impl<'a> UnwindSafe for NamedReference<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more