pub struct LazyCache<T> { /* private fields */ }
Expand description
A thread-safe, lazily-initialized value.
Implementations§
Source§impl<T, E: Clone> LazyCache<Result<T, E>>
impl<T, E: Clone> LazyCache<Result<T, E>>
pub fn try_get_or_err(&self) -> Result<&T, LazyCacheErrorOr<E>>
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for LazyCache<T>
impl<'de, T> Deserialize<'de> for LazyCache<T>
Source§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<T: Send> Send for LazyCache<T>
impl<T: Send + Sync> Sync for LazyCache<T>
Auto Trait Implementations§
impl<T> !Freeze for LazyCache<T>
impl<T> !RefUnwindSafe for LazyCache<T>
impl<T> Unpin for LazyCache<T>where
T: Unpin,
impl<T> !UnwindSafe for LazyCache<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