pub struct LazyNavigation<T> { /* private fields */ }Expand description
Opt-in lazy single navigation wrapper.
This type never performs I/O by itself. It only records whether a related
value has been explicitly loaded by an ORM operation such as include(...)
or a future explicit lazy-loading API that receives a context-bearing value.
Implementations§
Sourcepub fn from_option(value: Option<T>) -> Self
pub fn from_option(value: Option<T>) -> Self
Creates a loaded lazy navigation from an optional related entity.
Sourcepub fn as_ref(&self) -> Option<&T>
pub fn as_ref(&self) -> Option<&T>
Returns the loaded related entity when one is present.
This is a memory-only accessor. It never executes SQL.
Sourcepub fn set_loaded(&mut self, value: Option<T>)
pub fn set_loaded(&mut self, value: Option<T>)
Replaces the loaded value and marks this wrapper as loaded.
Trait Implementations§
Source§fn clone(&self) -> LazyNavigation<T>
fn clone(&self) -> LazyNavigation<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§fn eq(&self, other: &LazyNavigation<T>) -> bool
fn eq(&self, other: &LazyNavigation<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.Auto Trait Implementations§
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