Struct bonsaidb::client::ApiCallback
source · pub struct ApiCallback<Api>where
Api: Api,{ /* private fields */ }
Expand description
A callback that is invoked when an Api::Response
value is received out-of-band (not in reply to a request).
Implementations§
source§impl<Api> ApiCallback<Api>where
Api: Api,
impl<Api> ApiCallback<Api>where
Api: Api,
sourcepub fn new<F, Fut>(callback: F) -> ApiCallback<Api>
pub fn new<F, Fut>(callback: F) -> ApiCallback<Api>
Returns a new instance wrapping the provided function.
sourcepub fn new_with_context<Context, F, Fut>(
context: Context,
callback: F
) -> ApiCallback<Api>
pub fn new_with_context<Context, F, Fut>( context: Context, callback: F ) -> ApiCallback<Api>
Returns a new instance wrapping the provided function, passing a clone
of context
as the second parameter. This is just a convenience wrapper
around new()
that produces more readable code when needing to access
external information inside of the callback.
Auto Trait Implementations§
impl<Api> !RefUnwindSafe for ApiCallback<Api>
impl<Api> Send for ApiCallback<Api>
impl<Api> Sync for ApiCallback<Api>
impl<Api> Unpin for ApiCallback<Api>
impl<Api> !UnwindSafe for ApiCallback<Api>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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