Struct salvo_core::Depot [−][src]
pub struct Depot { /* fields omitted */ }
Expand description
Depot if for store temp data of current request. Each handler can read or write data to it.
Implementations
Creates an empty Depot
.
The depot is initially created with a capacity of 0, so it will not allocate until it is first inserted into.
Creates an empty Depot
with the specified capacity.
The depot will be able to hold at least capacity elements without reallocating. If capacity is 0, the depot will not allocate.
Returns the number of elements the depot can hold without reallocating.
Inserts a key-value pair into the depot.
Immutably borrows value from depot, returing none if value is not present in depot.
Immutably borrows value from depot.
Panics
Panics if the value is currently mutably borrowed or not present in depot. For a non-panicking variant, use
try_borrow
.
Mutably borrows value from depot, returing none if value is not present in depot.
Mutably borrows value from depot.
Panics
Panics if the value is currently borrowed or not present in depot. For a non-panicking variant, use
try_borrow_mut
.
Take value from depot container.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Depot
impl !UnwindSafe for Depot
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more