pub struct Extensions { /* private fields */ }Expand description
A type that can be used to dynamically store data by type.
§Examples
use extendable::Extensions;
let mut extensions = Extensions::default();
// Insert an extension with type `u32`.
extensions.insert::<u32>(42);
// Get a reference to the extension with type `u32` and asset its equal to 42.
assert_eq!(extensions.get::<u32>(), Some(&42));Implementations§
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 Freeze for Extensions
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