Lines Matching refs:Lazy
41 pub struct Lazy<T, F = fn() -> T> { struct
46 impl<T: fmt::Debug, F> fmt::Debug for Lazy<T, F> { argument
57 unsafe impl<T, F: Send> Sync for Lazy<T, F> where Once<T>: Sync {} implementation
60 impl<T, F> Lazy<T, F> { impl
63 pub const fn new(f: F) -> Lazy<T, F> { in new()
64 Lazy { cell: Once::new(), init: Cell::new(Some(f)) } in new()
68 impl<T, F: FnOnce() -> T> Lazy<T, F> { implementation
83 pub fn force(this: &Lazy<T, F>) -> &T { in force()
91 impl<T, F: FnOnce() -> T> Deref for Lazy<T, F> { implementation
94 Lazy::force(self) in deref()
98 impl<T: Default> Default for Lazy<T> { implementation
100 fn default() -> Lazy<T> { in default()
101 Lazy::new(T::default) in default()