Struct near_sdk::collections::LazyOption [−][src]
pub struct LazyOption<T> { /* fields omitted */ }
Expand description
An persistent lazy option, that stores a value in the storage.
Implementations
Create a new lazy option with the given storage_key
and the initial value.
Removes the value from storage without reading it. Returns whether the value was present.
Sets the value into the storage without reading the previous value and returns whether the previous value was present.
Trait Implementations
Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more
Deserialize this instance from a slice of bytes.
Whether Self is u8.
NOTE: Vec<u8>
is the most common use-case for serialization and deserialization, it’s
worth handling it as a special case to improve performance.
It’s a workaround for specific Vec<u8>
implementation versus generic Vec<T>
implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details. Read more
Serialize this instance into a vector of bytes.
Whether Self is u8.
NOTE: Vec<u8>
is the most common use-case for serialization and deserialization, it’s
worth handling it as a special case to improve performance.
It’s a workaround for specific Vec<u8>
implementation versus generic Vec<T>
implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for LazyOption<T> where
T: RefUnwindSafe,
impl<T> Send for LazyOption<T> where
T: Send,
impl<T> Sync for LazyOption<T> where
T: Sync,
impl<T> Unpin for LazyOption<T> where
T: Unpin,
impl<T> UnwindSafe for LazyOption<T> where
T: UnwindSafe,