pub struct Blocking<P: Provider> { /* private fields */ }Available on crate feature
blocking only.Expand description
A provider plus an owned runtime. Async callers use the provider directly.
Implementations§
Source§impl<P: Provider> Blocking<P>
impl<P: Provider> Blocking<P>
Sourcepub fn new(provider: P) -> Result<Self>
pub fn new(provider: P) -> Result<Self>
Build a private runtime with timers and I/O enabled.
§Errors
Returns Runtime if the owned Tokio runtime cannot be created.
Sourcepub fn ask(&self, request: &Request) -> Result<Answers>
pub fn ask(&self, request: &Request) -> Result<Answers>
Run one checked request. Reject nesting inside an active Tokio runtime.
§Errors
Returns Runtime inside an active Tokio runtime or if this facade has
shut down. Otherwise propagates request, provider, and response-validation
errors from the checked async call.
Trait Implementations§
Auto Trait Implementations§
impl<P> !Freeze for Blocking<P>
impl<P> RefUnwindSafe for Blocking<P>where
P: RefUnwindSafe,
impl<P> Send for Blocking<P>
impl<P> Sync for Blocking<P>
impl<P> Unpin for Blocking<P>where
P: Unpin,
impl<P> UnsafeUnpin for Blocking<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Blocking<P>where
P: UnwindSafe,
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