pub struct CasbinActor<T: IEnforcer + 'static> {
pub enforcer: Option<Arc<RwLock<T>>>,
}Fields§
§enforcer: Option<Arc<RwLock<T>>>Implementations§
Source§impl<T: IEnforcer + 'static> CasbinActor<T>
impl<T: IEnforcer + 'static> CasbinActor<T>
pub async fn new<M: TryIntoModel, A: TryIntoAdapter>( m: M, a: A, ) -> Result<Addr<CasbinActor<T>>>
pub fn set_enforcer(e: Arc<RwLock<T>>) -> Result<CasbinActor<T>>
pub fn get_enforcer(&mut self) -> Option<Arc<RwLock<T>>>
Trait Implementations§
Source§impl<T: IEnforcer + 'static> Actor for CasbinActor<T>
impl<T: IEnforcer + 'static> Actor for CasbinActor<T>
Source§type Context = Context<CasbinActor<T>>
type Context = Context<CasbinActor<T>>
Actor execution context type
Source§fn started(&mut self, ctx: &mut Self::Context)
fn started(&mut self, ctx: &mut Self::Context)
Called when an actor gets polled the first time.
Source§fn stopping(&mut self, ctx: &mut Self::Context) -> Running
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
Called after an actor is in
Actor::Stopping state. Read moreSource§fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
Start new actor in arbiter’s thread.
Source§impl<T: IEnforcer + 'static> Handler<CasbinCmd> for CasbinActor<T>
impl<T: IEnforcer + 'static> Handler<CasbinCmd> for CasbinActor<T>
Source§type Result = Pin<Box<dyn ActorFuture<CasbinActor<T>, Output = Result<CasbinResult, Error>>>>
type Result = Pin<Box<dyn ActorFuture<CasbinActor<T>, Output = Result<CasbinResult, Error>>>>
The type of value that this handler will return. Read more
Source§impl<T: IEnforcer + 'static> Supervised for CasbinActor<T>
impl<T: IEnforcer + 'static> Supervised for CasbinActor<T>
Source§fn restarting(&mut self, _: &mut Self::Context)
fn restarting(&mut self, _: &mut Self::Context)
Called when the supervisor restarts a failed actor.
Auto Trait Implementations§
impl<T> Freeze for CasbinActor<T>
impl<T> !RefUnwindSafe for CasbinActor<T>
impl<T> Send for CasbinActor<T>
impl<T> Sync for CasbinActor<T>
impl<T> Unpin for CasbinActor<T>
impl<T> !UnwindSafe for CasbinActor<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more