pub type Jit<T> = JitCore<T, Infallible>;
Aliased Type§
struct Jit<T> {
inner: Arc<JitInner<T, Infallible>>,
}
Fields§
§inner: Arc<JitInner<T, Infallible>>
Implementations
Source§impl<T, E> JitCore<T, E>
impl<T, E> JitCore<T, E>
Sourcepub fn new_try<Fut>(f: impl FnOnce() -> Fut + 'static + MaybeSend) -> Self
pub fn new_try<Fut>(f: impl FnOnce() -> Fut + 'static + MaybeSend) -> Self
Create JitTry
value, and spawn a future f
that computes its value
Unlike normal Rust futures, the f
executes eagerly (is spawned as a
tokio task).
Sourcepub async fn get_try(&self) -> Result<&T, OneTimeError<E>>
pub async fn get_try(&self) -> Result<&T, OneTimeError<E>>
Get the reference to the value, potentially blocking for the initialization future to complete