Trait persian_rug::Mutator
source · pub trait Mutator {
type Context: Context;
// Required methods
fn add<T>(&mut self, proxy: T) -> Proxy<T>
where Self::Context: Owner<T>,
T: Contextual<Context = Self::Context>;
fn get<T>(&self, what: &Proxy<T>) -> &T
where Self::Context: Owner<T>,
T: Contextual<Context = Self::Context>;
fn get_mut<T>(&mut self, what: &Proxy<T>) -> &mut T
where Self::Context: Owner<T>,
T: Contextual<Context = Self::Context>;
fn get_iter<T>(&self) -> TableIterator<'_, T> ⓘ
where Self::Context: Owner<T>,
T: Contextual<Context = Self::Context>;
fn get_iter_mut<T>(&mut self) -> TableMutIterator<'_, T> ⓘ
where Self::Context: Owner<T>,
T: Contextual<Context = Self::Context>;
fn get_proxy_iter<T>(&self) -> TableProxyIterator<'_, T> ⓘ
where Self::Context: Owner<T>,
T: Contextual<Context = Self::Context>;
}
Expand description
A convenient way to handle Context
write access.
Rather than plumbing references to a context throughout your code, especially when you are implementing derive macros that rely on this crate, it can be more convenient to use this abstraction of read-write access to a context.
In most hand-written code, it is simplest to use an exclusive reference to a context as a Mutator.
Required Associated Types§
Required Methods§
fn add<T>(&mut self, proxy: T) -> Proxy<T>
fn get<T>(&self, what: &Proxy<T>) -> &T
fn get_mut<T>(&mut self, what: &Proxy<T>) -> &mut T
fn get_iter<T>(&self) -> TableIterator<'_, T> ⓘ
fn get_iter_mut<T>(&mut self) -> TableMutIterator<'_, T> ⓘ
fn get_proxy_iter<T>(&self) -> TableProxyIterator<'_, T> ⓘ
Object Safety§
This trait is not object safe.