pub struct Extensions { /* private fields */ }Expand description
A type map of request extensions.
Implementations§
Source§impl Extensions
impl Extensions
Sourcepub fn new() -> Extensions
pub fn new() -> Extensions
Create an empty Extensions.
Sourcepub fn insert<T: 'static>(&mut self, val: T) -> Option<T>
pub fn insert<T: 'static>(&mut self, val: T) -> Option<T>
Insert a type into this Extensions.
If a extension of this type already existed, it will be returned.
Sourcepub fn get<T: 'static>(&self) -> Option<&T>
pub fn get<T: 'static>(&self) -> Option<&T>
Get a reference to a type previously inserted on this Extensions.
Sourcepub fn get_mut<T: 'static>(&mut self) -> Option<&mut T>
pub fn get_mut<T: 'static>(&mut self) -> Option<&mut T>
Get a mutable reference to a type previously inserted on this Extensions.
Sourcepub fn remove<T: 'static>(&mut self) -> Option<T>
pub fn remove<T: 'static>(&mut self) -> Option<T>
Remove a type from this Extensions.
If a extension of this type existed, it will be returned.
Sourcepub fn extend(&mut self, other: Extensions)
pub fn extend(&mut self, other: Extensions)
Add all items from other Extensions
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Debug for Extensions
impl Debug for Extensions
Source§impl Default for Extensions
impl Default for Extensions
Source§fn default() -> Extensions
fn default() -> Extensions
Returns the “default value” for a type. Read more