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

Holder of global dispatch-related data

This struct serves as a dynamic container for the dispatch-time global data that you gave to the dispatch method, and is given as input to all your callbacks. It allows you to share global state between your filters.

The main method of interest is the get method, which allows you to access a &mut _ reference to the global data itself. The other methods are mostly used internally by the crate.

Implementations

Access the dispatch data knowing its type

Will return None if the provided type is not the correct inner type.

Wrap a mutable reference

This creates a new DispatchData from a mutable reference

Reborrows this DispatchData to create a new one with the same content

This is a quick and cheap way to propagate the DispatchData down a callback stack by value. It is basically a noop only there to ease work with the borrow checker.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.