Struct azure_core::Context

source ·
pub struct Context { /* private fields */ }
Expand description

Pipeline execution context.

Implementations§

source§

impl Context

source

pub fn new() -> Self

Creates a new, empty Context.

source

pub fn insert_or_replace<E>(&mut self, entity: E) -> Option<Arc<E>>where E: Send + Sync + 'static,

Inserts or replaces an entity in the type map. If an entity with the same type was displaced by the insert, it will be returned to the caller.

source

pub fn insert<E>(&mut self, entity: E) -> &mut Selfwhere E: Send + Sync + 'static,

Inserts an entity in the type map. If the an entity with the same type signature is already present it will be silently dropped. This function returns a mutable reference to the same Context so it can be chained to itself.

source

pub fn remove<E>(&mut self) -> Option<Arc<E>>where E: Send + Sync + 'static,

Removes an entity from the type map. If present, the entity will be returned.

source

pub fn get<E>(&self) -> Option<&E>where E: Send + Sync + 'static,

Returns a reference of the entity of the specified type signature, if it exists.

If there is no entity with the specific type signature, None is returned instead.

source

pub fn len(&self) -> usize

Returns the number of entities in the type map.

source

pub fn is_empty(&self) -> bool

Returns true if the type map is empty, false otherwise.

Trait Implementations§

source§

impl Clone for Context

source§

fn clone(&self) -> Context

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Context

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Context

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V