Trait persian_rug::Accessor
source · pub trait Accessor: Clone {
type Context: Context;
// Required methods
fn get<T>(&self, what: &Proxy<T>) -> &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_proxy_iter<T>(&self) -> TableProxyIterator<'_, T> ⓘ
where Self::Context: Owner<T>,
T: Contextual<Context = Self::Context>;
}
Expand description
A convenient way to handle Context
read 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-only access to a context.
In most hand-written code, it is simplest to use a shared reference to a context as an Accessor.
Required Associated Types§
Required Methods§
fn get<T>(&self, what: &Proxy<T>) -> &T
fn get_iter<T>(&self) -> TableIterator<'_, T> ⓘ
fn get_proxy_iter<T>(&self) -> TableProxyIterator<'_, T> ⓘ
Object Safety§
This trait is not object safe.