Struct InContextMut

Source
pub struct InContextMut<'a, D>
where D: Contextual,
{ /* private fields */ }
Expand description

A short-term binding of Context and any mutable object of a type that implements the Contextual trait.

The purpose of this type is to allow a transparent read access to shared data, like names etc. To prevent coarse-grained locking, Context is internally represented by a ContextHandle; however, Context can’t be modified through InContextMut.

Implementations§

Source§

impl<D> InContextMut<'_, D>
where D: Contextual,

Source

pub fn using_context<T, F>(&mut self, f: F) -> T
where F: FnOnce(&mut D, &Context) -> T,

Source

pub fn same_context(&self, other: &InContextMut<'_, D>) -> bool

Source

pub fn get_context(&self) -> &Arc<Mutex<Context>>

Source

pub fn get_thing(&self) -> &D

Source

pub fn get_thing_mut(&mut self) -> &mut D

Trait Implementations§

Source§

impl<'a> AddAssign<&InContextMut<'a, Polynomial<LinkID>>> for InContextMut<'a, Polynomial<LinkID>>

Source§

fn add_assign(&mut self, other: &InContextMut<'a, Polynomial<LinkID>>)

Performs the += operation. Read more
Source§

impl<'a, D> Display for InContextMut<'a, D>
where D: Contextual,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, D> Freeze for InContextMut<'a, D>

§

impl<'a, D> RefUnwindSafe for InContextMut<'a, D>
where D: RefUnwindSafe,

§

impl<'a, D> Send for InContextMut<'a, D>
where D: Send,

§

impl<'a, D> Sync for InContextMut<'a, D>
where D: Sync,

§

impl<'a, D> Unpin for InContextMut<'a, D>

§

impl<'a, D> !UnwindSafe for InContextMut<'a, D>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Reference
where Reference: HasPart<Outer> + ?Sized, Outer: Part<PartType = Field<OuterFieldType>>, Inner: Part, OuterFieldType: HasPart<Inner, RawTarget = OuterFieldType> + PartialRefTarget + ?Sized,

Source§

unsafe fn part_ptr( ptr: *const <Reference as PartialRefTarget>::RawTarget, ) -> <<Inner as Part>::PartType as PartType>::Ptr

Given a constant pointer to a target, produce a constant pointer to a part of it.
Source§

unsafe fn part_ptr_mut( ptr: *mut <Reference as PartialRefTarget>::RawTarget, ) -> <<Inner as Part>::PartType as PartType>::PtrMut

Given a mutable pointer to a target, produce a mutable pointer to a part of it.
Source§

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

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V