Trait casbin::CoreApi

source ·
pub trait CoreApi: Send + Sync {
Show 28 methods // Required methods fn new_raw<'async_trait, M, A>( m: M, a: A ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where Self: Sized + 'async_trait, M: 'async_trait + TryIntoModel, A: 'async_trait + TryIntoAdapter; fn new<'async_trait, M, A>( m: M, a: A ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where Self: Sized + 'async_trait, M: 'async_trait + TryIntoModel, A: 'async_trait + TryIntoAdapter; fn add_function( &mut self, fname: &str, f: fn(_: ImmutableString, _: ImmutableString) -> bool ); fn get_model(&self) -> &dyn Model; fn get_mut_model(&mut self) -> &mut dyn Model; fn get_adapter(&self) -> &dyn Adapter; fn get_mut_adapter(&mut self) -> &mut dyn Adapter; fn get_role_manager(&self) -> Arc<RwLock<dyn RoleManager>>; fn set_role_manager( &mut self, rm: Arc<RwLock<dyn RoleManager>> ) -> Result<()>; fn set_model<'life0, 'async_trait, M>( &'life0 mut self, m: M ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sized + 'async_trait, M: 'async_trait + TryIntoModel, 'life0: 'async_trait; fn set_adapter<'life0, 'async_trait, A>( &'life0 mut self, a: A ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sized + 'async_trait, A: 'async_trait + TryIntoAdapter, 'life0: 'async_trait; fn set_effector(&mut self, e: Box<dyn Effector>); fn enforce<ARGS: EnforceArgs>(&self, rvals: ARGS) -> Result<bool> where Self: Sized; fn enforce_with_context<ARGS: EnforceArgs>( &self, ctx: EnforceContext, rvals: ARGS ) -> Result<bool> where Self: Sized; fn enforce_mut<ARGS: EnforceArgs>(&mut self, rvals: ARGS) -> Result<bool> where Self: Sized; fn build_role_links(&mut self) -> Result<()>; fn build_incremental_role_links(&mut self, d: EventData) -> Result<()>; fn load_policy<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn load_filtered_policy<'a, 'life0, 'async_trait>( &'life0 mut self, f: Filter<'a> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn is_filtered(&self) -> bool; fn is_enabled(&self) -> bool; fn save_policy<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn clear_policy<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn enable_auto_save(&mut self, auto_save: bool); fn enable_enforce(&mut self, enabled: bool); fn enable_auto_build_role_links(&mut self, auto_build_role_links: bool); fn has_auto_save_enabled(&self) -> bool; fn has_auto_build_role_links_enabled(&self) -> bool;
}

Required Methods§

source

fn new_raw<'async_trait, M, A>( m: M, a: A ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, M: 'async_trait + TryIntoModel, A: 'async_trait + TryIntoAdapter,

source

fn new<'async_trait, M, A>( m: M, a: A ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, M: 'async_trait + TryIntoModel, A: 'async_trait + TryIntoAdapter,

source

fn add_function( &mut self, fname: &str, f: fn(_: ImmutableString, _: ImmutableString) -> bool )

source

fn get_model(&self) -> &dyn Model

source

fn get_mut_model(&mut self) -> &mut dyn Model

source

fn get_adapter(&self) -> &dyn Adapter

source

fn get_mut_adapter(&mut self) -> &mut dyn Adapter

source

fn get_role_manager(&self) -> Arc<RwLock<dyn RoleManager>>

source

fn set_role_manager(&mut self, rm: Arc<RwLock<dyn RoleManager>>) -> Result<()>

source

fn set_model<'life0, 'async_trait, M>( &'life0 mut self, m: M ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, M: 'async_trait + TryIntoModel, 'life0: 'async_trait,

source

fn set_adapter<'life0, 'async_trait, A>( &'life0 mut self, a: A ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, A: 'async_trait + TryIntoAdapter, 'life0: 'async_trait,

source

fn set_effector(&mut self, e: Box<dyn Effector>)

source

fn enforce<ARGS: EnforceArgs>(&self, rvals: ARGS) -> Result<bool>
where Self: Sized,

source

fn enforce_with_context<ARGS: EnforceArgs>( &self, ctx: EnforceContext, rvals: ARGS ) -> Result<bool>
where Self: Sized,

source

fn enforce_mut<ARGS: EnforceArgs>(&mut self, rvals: ARGS) -> Result<bool>
where Self: Sized,

source

fn load_policy<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn load_filtered_policy<'a, 'life0, 'async_trait>( &'life0 mut self, f: Filter<'a> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn is_filtered(&self) -> bool

source

fn is_enabled(&self) -> bool

source

fn save_policy<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn clear_policy<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn enable_auto_save(&mut self, auto_save: bool)

source

fn enable_enforce(&mut self, enabled: bool)

source

fn has_auto_save_enabled(&self) -> bool

Implementors§