Trait Contextual

Source
pub trait Contextual: Sized {
    // Required method
    fn format(&self, ctx: &Arc<Mutex<Context>>) -> Result<String, AcesError>;

    // Provided methods
    fn with(&self, ctx: &Arc<Mutex<Context>>) -> InContext<'_, Self> { ... }
    fn with_mut(&mut self, ctx: &Arc<Mutex<Context>>) -> InContextMut<'_, Self> { ... }
}
Expand description

A trait for binding objects to Context temporarily, without permanently storing (and synchronizing) context references inside the objects.

See InContext for more details.

Required Methods§

Provided Methods§

Source

fn with(&self, ctx: &Arc<Mutex<Context>>) -> InContext<'_, Self>

Source

fn with_mut(&mut self, ctx: &Arc<Mutex<Context>>) -> InContextMut<'_, Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> Contextual for Vec<T>

Implementors§