pub struct Lazy<T> { /* private fields */ }
Expand description
Lazy-loaded model.
Implementations§
Source§impl<T> Lazy<T>
impl<T> Lazy<T>
Sourcepub fn into_inner(self) -> Cell
pub fn into_inner(self) -> Cell
Converts into the underlying cell.
Sourcepub fn cast_into<Q>(self) -> Lazy<Q>where
Q: EquivalentRepr<T>,
pub fn cast_into<Q>(self) -> Lazy<Q>where
Q: EquivalentRepr<T>,
Converts into a lazy loader for an equivalent type.
Sourcepub fn cast_ref<Q>(&self) -> &Lazy<Q>where
Q: EquivalentRepr<T>,
pub fn cast_ref<Q>(&self) -> &Lazy<Q>where
Q: EquivalentRepr<T>,
Casts itself into a lazy loaded for an equivalent type.
Sourcepub fn serialize_repr_hash<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
pub fn serialize_repr_hash<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
Serializes only the root hash of the cell.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Lazy<T>where
T: Deserialize<'de> + Store,
impl<'de, T> Deserialize<'de> for Lazy<T>where
T: Deserialize<'de> + Store,
Source§fn deserialize<D>(deserializer: D) -> Result<Lazy<T>, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Lazy<T>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> ExactSize for Lazy<T>
impl<T> ExactSize for Lazy<T>
Source§fn exact_size(&self) -> Size
fn exact_size(&self) -> Size
Exact size of the value when it is stored in a slice.
Source§impl<T> Store for Lazy<T>
impl<T> Store for Lazy<T>
Source§fn store_into(
&self,
builder: &mut CellBuilder,
_: &mut dyn CellContext,
) -> Result<(), Error>
fn store_into( &self, builder: &mut CellBuilder, _: &mut dyn CellContext, ) -> Result<(), Error>
Tries to store itself into the cell builder.
Source§impl<T: WithAbiType> WithAbiType for Lazy<T>
impl<T: WithAbiType> WithAbiType for Lazy<T>
impl<T> Eq for Lazy<T>
Auto Trait Implementations§
impl<T> Freeze for Lazy<T>
impl<T> !RefUnwindSafe for Lazy<T>
impl<T> Send for Lazy<T>where
T: Send,
impl<T> Sync for Lazy<T>where
T: Sync,
impl<T> Unpin for Lazy<T>where
T: Unpin,
impl<T> !UnwindSafe for Lazy<T>
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
Compares
self
to key
and returns true
if they are equal.