Struct truelayer_extensions::Extensions [−][src]
pub struct Extensions { /* fields omitted */ }
Expand description
Extensions
is a type map: values are stored and retrieved using their
TypeId
.
This allows storing arbitrary data that implements Sync + Send + 'static
. This is
useful when you need to share data between different middlewares in the middleware chain
or make some values available from the handler to middlewares
on the outgoing path (e.g. error class).
Implementations
Insert a value into this Extensions
.
If a value of this type already exists, it will be returned.
Get a reference to a value previously inserted on this Extensions
.
Get a mutable reference to a value previously inserted on this Extensions
.
Remove a value from this Extensions
.
If a value of this type exists, it will be returned.
Trait Implementations
Returns the “default value” for a type. Read more