pub enum HasOne<E: EntityTrait> {
Unloaded,
NotFound,
Loaded(Box<E::ModelEx>),
}Variantsยง
Implementationsยง
Sourceยงimpl<E: EntityTrait> HasOne<E>
impl<E: EntityTrait> HasOne<E>
Sourcepub fn is_unloaded(&self) -> bool
pub fn is_unloaded(&self) -> bool
Return true if variant is Unloaded
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Return true if variant is NotFound
Sourcepub fn into_option(self) -> Option<E::ModelEx>
pub fn into_option(self) -> Option<E::ModelEx>
Convert into an Option<ModelEx>
Sourceยงimpl<E> HasOne<E>
impl<E> HasOne<E>
pub fn into_active_model(self) -> HasOneModel<E>
Trait Implementationsยง
Sourceยงimpl<E: EntityTrait> Default for HasOne<E>
impl<E: EntityTrait> Default for HasOne<E>
Sourceยงimpl<'de, E> Deserialize<'de> for HasOne<E>
Available on crate feature with-json only.
impl<'de, E> Deserialize<'de> for HasOne<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<E: EntityTrait> From<Option<Box<<E as EntityTrait>::ModelEx>>> for HasOne<E>
impl<E: EntityTrait> From<Option<Box<<E as EntityTrait>::ModelEx>>> for HasOne<E>
impl<E> Eq for HasOne<E>
Auto Trait Implementationsยง
impl<E> Freeze for HasOne<E>
impl<E> RefUnwindSafe for HasOne<E>
impl<E> Send for HasOne<E>
impl<E> Sync for HasOne<E>
impl<E> Unpin for HasOne<E>
impl<E> UnwindSafe for HasOne<E>
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<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