pub struct CallbackBuilderWithArg<'a, Arg = (), T = (), Out = (), F: Fn(Arg, T) -> Out + 'static = fn(Arg, T) -> Out, Rule = AllowNull, State = Unconstructed> { /* private fields */ }Expand description
A CallbackBuilder which includes an argument passed from the system to the callback.
Implementations§
Source§impl<'a, Arg, T, Out, F: Fn(Arg, T) -> Out + 'static, Rule> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, Unconstructed>
impl<'a, Arg, T, Out, F: Fn(Arg, T) -> Out + 'static, Rule> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, Unconstructed>
Sourcepub fn with(
callbacks: &'a mut Callbacks<T>,
) -> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, WithCallacks>
pub fn with( callbacks: &'a mut Callbacks<T>, ) -> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, WithCallacks>
Attach a Callbacks object to this builder, that will hold the closure.
Source§impl<'a, Arg, T, Out, F: Fn(Arg, T) -> Out + 'static, Rule> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, WithCallacks>
impl<'a, Arg, T, Out, F: Fn(Arg, T) -> Out + 'static, Rule> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, WithCallacks>
Sourcepub fn call(
self,
cb: F,
) -> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, Constructed>
pub fn call( self, cb: F, ) -> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, Constructed>
Attach a closure to this builder, which will be held in the Callbacks object and called via
that same Callbacks object.
Auto Trait Implementations§
impl<'a, Arg, T, Out, F, Rule, State> Freeze for CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, State>where
F: Freeze,
impl<'a, Arg = (), T = (), Out = (), F = fn(Arg, T) -> Out, Rule = AllowNull, State = Unconstructed> !RefUnwindSafe for CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, State>
impl<'a, Arg = (), T = (), Out = (), F = fn(Arg, T) -> Out, Rule = AllowNull, State = Unconstructed> !Send for CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, State>
impl<'a, Arg = (), T = (), Out = (), F = fn(Arg, T) -> Out, Rule = AllowNull, State = Unconstructed> !Sync for CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, State>
impl<'a, Arg, T, Out, F, Rule, State> Unpin for CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, State>
impl<'a, Arg = (), T = (), Out = (), F = fn(Arg, T) -> Out, Rule = AllowNull, State = Unconstructed> !UnwindSafe for CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, State>
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