pub trait ContextExt: Context {
    // Provided method
    fn lookup<T: Object>(&self, id: &ObjectId) -> Result<Arc<T>, LookupError> { ... }
}
Expand description

Extension trait for Context.

This is a separate trait so that Context can be object-safe.

Provided Methods§

source

fn lookup<T: Object>(&self, id: &ObjectId) -> Result<Arc<T>, LookupError>

Look up an object of a given type, and downcast it.

Return an error if the object can’t be found, or has the wrong type.

Implementors§