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,
impl<D> InContextMut<'_, D>where
D: Contextual,
pub fn using_context<T, F>(&mut self, f: F) -> T
pub fn same_context(&self, other: &InContextMut<'_, D>) -> bool
pub fn get_context(&self) -> &Arc<Mutex<Context>>
pub fn get_thing(&self) -> &D
pub fn get_thing_mut(&mut self) -> &mut D
Trait Implementations§
Source§impl<'a> AddAssign<&InContextMut<'a, Polynomial<LinkID>>> for InContextMut<'a, Polynomial<LinkID>>
impl<'a> AddAssign<&InContextMut<'a, Polynomial<LinkID>>> for InContextMut<'a, Polynomial<LinkID>>
Source§fn add_assign(&mut self, other: &InContextMut<'a, Polynomial<LinkID>>)
fn add_assign(&mut self, other: &InContextMut<'a, Polynomial<LinkID>>)
Performs the
+= operation. Read moreAuto 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> 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
Source§impl<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Reference
impl<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Reference
Source§unsafe fn part_ptr(
ptr: *const <Reference as PartialRefTarget>::RawTarget,
) -> <<Inner as Part>::PartType as PartType>::Ptr
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
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.