Struct ntex::util::Extensions
source · 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>(&mut self, val: T)where
T: 'static,
pub fn insert<T>(&mut self, val: T)where
T: 'static,
Insert a type into this Extensions.
If a extension of this type already existed, it will be returned.
sourcepub fn get<T>(&self) -> Option<&T>where
T: 'static,
pub fn get<T>(&self) -> Option<&T>where
T: 'static,
Get a reference to a type previously inserted on this Extensions.
sourcepub fn get_mut<T>(&mut self) -> Option<&mut T>where
T: 'static,
pub fn get_mut<T>(&mut self) -> Option<&mut T>where
T: 'static,
Get a mutable reference to a type previously inserted on this Extensions.
sourcepub fn remove<T>(&mut self) -> Option<T>where
T: 'static,
pub fn remove<T>(&mut self) -> Option<T>where
T: 'static,
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
Auto Trait Implementations§
impl !RefUnwindSafe for Extensions
impl !Send for Extensions
impl !Sync for Extensions
impl Unpin for Extensions
impl !UnwindSafe for Extensions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more