Struct actix_web::Extensions
source · pub struct Extensions { /* private fields */ }
Expand description
A type map of request extensions.
Implementations
sourceimpl Extensions
impl Extensions
sourcepub fn new() -> Extensions
pub fn new() -> Extensions
Create an empty Extensions
.
sourcepub fn insert<T: 'static>(&mut self, val: T)
pub fn insert<T: 'static>(&mut self, val: 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
.
Trait Implementations
sourceimpl Debug for Extensions
impl Debug for Extensions
sourceimpl Default for Extensions
impl Default for Extensions
sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more