pub trait TypeTreeForUser: Send + Sync {
// Required methods
fn get_type_tree_for_user<'a>(
&'a self,
ctx: &'a RequestContext,
) -> Box<dyn TypeTreeReadContext + 'a>;
fn get_type_tree_static(
&self,
ctx: &RequestContext,
) -> Arc<dyn TypeTreeForUserStatic>;
}Expand description
Trait for providing a dynamic type tree for a user.
This is a bit complex, it doesn’t return a type tree directly,
instead it returns something that wraps a type tree, for example
a RwLockReadGuard<'_, RawRwLock, dyn TypeTree>
Required Methods§
Sourcefn get_type_tree_for_user<'a>(
&'a self,
ctx: &'a RequestContext,
) -> Box<dyn TypeTreeReadContext + 'a>
fn get_type_tree_for_user<'a>( &'a self, ctx: &'a RequestContext, ) -> Box<dyn TypeTreeReadContext + 'a>
Get the type tree for the user associated with the given ctx.
This can be the server global type tree, or a custom type tree for each individual user.
It is sync, so you should do any setup in your AuthManager implementation.
Sourcefn get_type_tree_static(
&self,
ctx: &RequestContext,
) -> Arc<dyn TypeTreeForUserStatic>
fn get_type_tree_static( &self, ctx: &RequestContext, ) -> Arc<dyn TypeTreeForUserStatic>
Get a static reference to a type tree getter for the current user. This is used to allow subscriptions to hold a reference to the type tree for events.