Skip to main content

resource

Function resource 

Source
pub fn resource<S, T, Fut>(
    source: impl Fn() -> S + 'static,
    fetch: impl Fn(S) -> Fut + 'static,
) -> Resource<T>
where S: Clone + PartialEq + 'static, T: 'static, Fut: Future<Output = T> + 'static,
Expand description

Creates a Resource in the current thread’s default reactor.

See Resource for semantics.