pub struct HasOne<O: Model> { /* private fields */ }Available on crate features
model-mysql or model-postgres or model-sqlite only.Expand description
Represents a one-to-one relationship (owner → child).
The fk_col column on the child table holds the owner’s PK.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<O> Freeze for HasOne<O>where
PhantomData<O>: Freeze,
impl<O> RefUnwindSafe for HasOne<O>where
PhantomData<O>: RefUnwindSafe,
impl<O> Send for HasOne<O>where
PhantomData<O>: Send,
impl<O> Sync for HasOne<O>where
PhantomData<O>: Sync,
impl<O> Unpin for HasOne<O>where
PhantomData<O>: Unpin,
impl<O> UnsafeUnpin for HasOne<O>where
PhantomData<O>: UnsafeUnpin,
impl<O> UnwindSafe for HasOne<O>where
PhantomData<O>: UnwindSafe,
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
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,
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