Function error_stack::provider::request_ref
source · [−]pub fn request_ref<'a, T, P>(provider: &'a P) -> Option<&'a T> where
T: 'static + ?Sized,
P: Provider + ?Sized,
Available on
nightly
only.Expand description
Request a reference from the Provider
.
Examples
Get a string reference from a provider.
use error_stack::provider::{request_ref, Provider};
fn get_str<P: Provider>(provider: &P) -> &str {
request_ref::<str, _>(provider).unwrap()
}