CallbackBuilderWithArg

Struct CallbackBuilderWithArg 

Source
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> CallbackBuilderWithArg<'a, (), (), (), fn((), ()), AllowNull, Unconstructed>

Source

pub fn none() -> CallbackBuilderWithArg<'a, (), (), (), fn((), ()), AllowNull, Constructed>

A null callback, which is used to specify a callback should not be set, or should be removed.

Source§

impl<'a, Arg, T, Out, F: Fn(Arg, T) -> Out + 'static, Rule> CallbackBuilderWithArg<'a, Arg, T, Out, F, Rule, Unconstructed>

Source

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>

Source

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>
where F: Unpin, Arg: Unpin, T: Unpin, Out: Unpin, Rule: Unpin, State: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.