pub enum BelongsTo<T>where
T: BelongsToCardinality,{
Unloaded,
Loaded(<T as BelongsToCardinality>::Loaded),
}Variantsยง
Implementationsยง
Sourceยงimpl<E> BelongsTo<E>where
E: EntityTrait,
impl<E> BelongsTo<E>where
E: EntityTrait,
Sourcepub fn into_option(self) -> Option<E::ModelEx>
pub fn into_option(self) -> Option<E::ModelEx>
Convert into an Option<ModelEx>
Sourceยงimpl<E> BelongsTo<Option<E>>where
E: EntityTrait,
impl<E> BelongsTo<Option<E>>where
E: EntityTrait,
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Return true if this optional relation was loaded and no model was found.
Sourcepub fn is_unloaded_or_not_found(&self) -> bool
pub fn is_unloaded_or_not_found(&self) -> bool
Return true if this optional relation holds no model โ i.e. it is either
Unloaded or was loaded with no match (is_not_found).
Sourcepub fn as_mut(&mut self) -> Option<&mut E::ModelEx>
pub fn as_mut(&mut self) -> Option<&mut E::ModelEx>
Get a mutable reference, if loaded with a model
Sourcepub fn into_option(self) -> Option<E::ModelEx>
pub fn into_option(self) -> Option<E::ModelEx>
Convert into an Option<ModelEx>
Sourceยงimpl<E> BelongsTo<E>
impl<E> BelongsTo<E>
pub fn into_active_model(self) -> ActiveBelongsTo<E>
Sourceยงimpl<E> BelongsTo<Option<E>>
impl<E> BelongsTo<Option<E>>
pub fn into_active_model(self) -> ActiveBelongsTo<Option<E>>
Trait Implementationsยง
Sourceยงimpl<T> Clone for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: Clone,
impl<T> Clone for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: Clone,
Sourceยงimpl<T> Debug for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: Debug,
impl<T> Debug for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: Debug,
Sourceยงimpl<'de, E> Deserialize<'de> for BelongsTo<E>
Available on crate feature with-json only.
impl<'de, E> Deserialize<'de> for BelongsTo<E>
Available on crate feature
with-json only.Sourceยง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
Sourceยงimpl<'de, E> Deserialize<'de> for BelongsTo<Option<E>>
Available on crate feature with-json only.
impl<'de, E> Deserialize<'de> for BelongsTo<Option<E>>
Available on crate feature
with-json only.Sourceยง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
impl<T> Eq for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: Eq,
Sourceยงimpl<E: EntityTrait> From<Option<Box<<E as EntityTrait>::ModelEx>>> for BelongsTo<E>
impl<E: EntityTrait> From<Option<Box<<E as EntityTrait>::ModelEx>>> for BelongsTo<E>
Sourceยงimpl<E: EntityTrait> From<Option<Box<<E as EntityTrait>::ModelEx>>> for BelongsTo<Option<E>>
impl<E: EntityTrait> From<Option<Box<<E as EntityTrait>::ModelEx>>> for BelongsTo<Option<E>>
Sourceยงimpl<T> Hash for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: Hash,
impl<T> Hash for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: Hash,
Sourceยงimpl<T> PartialEq for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: PartialEq,
impl<T> PartialEq for BelongsTo<T>where
T: BelongsToCardinality,
<T as BelongsToCardinality>::Loaded: PartialEq,
Auto Trait Implementationsยง
impl<T> Freeze for BelongsTo<T>where
<T as BelongsToCardinality>::Loaded: Freeze,
impl<T> RefUnwindSafe for BelongsTo<T>where
<T as BelongsToCardinality>::Loaded: RefUnwindSafe,
impl<T> Send for BelongsTo<T>where
<T as BelongsToCardinality>::Loaded: Send,
impl<T> Sync for BelongsTo<T>where
<T as BelongsToCardinality>::Loaded: Sync,
impl<T> Unpin for BelongsTo<T>where
<T as BelongsToCardinality>::Loaded: Unpin,
impl<T> UnsafeUnpin for BelongsTo<T>where
<T as BelongsToCardinality>::Loaded: UnsafeUnpin,
impl<T> UnwindSafe for BelongsTo<T>where
<T as BelongsToCardinality>::Loaded: UnwindSafe,
Blanket Implementationsยง
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more