Enum HasOne
pub enum HasOne<E: EntityTrait> {
Unloaded,
NotFound,
Loaded(Box<E::ModelEx>),
}Variants§
Implementations§
§impl<E: EntityTrait> HasOne<E>
impl<E: EntityTrait> HasOne<E>
pub fn is_unloaded(&self) -> bool
pub fn is_unloaded(&self) -> bool
Return true if variant is Unloaded
pub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Return true if variant is NotFound
pub fn into_option(self) -> Option<E::ModelEx>
pub fn into_option(self) -> Option<E::ModelEx>
Convert into an Option<ModelEx>
§impl<E> HasOne<E>
impl<E> HasOne<E>
pub fn into_active_model(self) -> HasOneModel<E>
Trait Implementations§
§impl<E: Clone + EntityTrait> Clone for HasOne<E>
impl<E: Clone + EntityTrait> Clone for HasOne<E>
§impl<E: Debug + EntityTrait> Debug for HasOne<E>
impl<E: Debug + EntityTrait> Debug for HasOne<E>
§impl<E: EntityTrait> Default for HasOne<E>
impl<E: EntityTrait> Default for HasOne<E>
§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.§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<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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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