pub struct Extensions { /* private fields */ }Expand description
Type-keyed cross-cutting state attached to an
crate::ExecutionContext. Operators add their own values via
crate::ExecutionContext::add_extension and read them back
via crate::ExecutionContext::extension.
Cloning is cheap — internally an Arc over the underlying map,
so cloning a context that already carries extensions does not
duplicate the entries.
Implementations§
Source§impl Extensions
impl Extensions
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty Extensions. Equivalent to
Default::default.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of entries currently stored. Diagnostic helper — production code rarely cares.
Trait Implementations§
Source§impl Clone for Extensions
impl Clone for Extensions
Source§fn clone(&self) -> Extensions
fn clone(&self) -> Extensions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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 UnsafeUnpin 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