pub struct SignalBuilder<'a> { /* private fields */ }
Expand description

Builder for signals.

Implementations§

source§

impl<'a> SignalBuilder<'a>

source

pub fn run_first(self) -> Self

Run the signal class handler in the first emission stage.

source

pub fn run_last(self) -> Self

Run the signal class handler in the third emission stage.

source

pub fn run_cleanup(self) -> Self

Run the signal class handler in the last emission stage.

source

pub fn no_recurse(self) -> Self

Signals being emitted for an object while currently being in emission for this very object will not be emitted recursively, but instead cause the first emission to be restarted.

source

pub fn detailed(self) -> Self

This signal supports “::detail” appendices to the signal name upon handler connections and emissions.

source

pub fn action(self) -> Self

Action signals are signals that may freely be emitted on alive objects from user code.

source

pub fn no_hooks(self) -> Self

No emissions hooks are supported for this signal.

source

pub fn must_collect(self) -> Self

Varargs signal emission will always collect the arguments, even if there are no signal handlers connected.

source

pub fn deprecated(self) -> Self

The signal is deprecated and will be removed in a future version.

source

pub fn flags(self, flags: SignalFlags) -> Self

Explicitly set all flags.

This overrides previously set flags on this builder.

source

pub fn class_handler<F: Fn(&SignalClassHandlerToken, &[Value]) -> Option<Value> + Send + Sync + 'static>( self, func: F ) -> Self

Class handler for this signal.

source

pub fn accumulator<F: Fn(&SignalInvocationHint, &mut Value, &Value) -> bool + Send + Sync + 'static>( self, func: F ) -> Self

Accumulator for the return values of the signal.

This is called if multiple signal handlers are connected to the signal for accumulating the return values into a single value.

source

pub fn build(self) -> Signal

Build the signal.

This does not register the signal yet, which only happens as part of object type registration.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for SignalBuilder<'a>

§

impl<'a> Send for SignalBuilder<'a>

§

impl<'a> Sync for SignalBuilder<'a>

§

impl<'a> Unpin for SignalBuilder<'a>

§

impl<'a> !UnwindSafe for SignalBuilder<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.