pub struct AuthStateMonitor { /* private fields */ }Expand description
Monitors certificates and emits state transition events.
Implementations§
Source§impl AuthStateMonitor
impl AuthStateMonitor
Sourcepub fn new(tracker: AuthStateTracker) -> Self
pub fn new(tracker: AuthStateTracker) -> Self
Create a new monitor with the given tracker.
Sourcepub fn update(
&mut self,
cert: &MembershipCertificate,
now_ms: u64,
) -> Option<AuthStateEvent>
pub fn update( &mut self, cert: &MembershipCertificate, now_ms: u64, ) -> Option<AuthStateEvent>
Update the monitor with current time and check for state transitions.
Returns an event if the state changed.
Sourcepub fn notify_renewed(
&mut self,
new_cert: &MembershipCertificate,
) -> AuthStateEvent
pub fn notify_renewed( &mut self, new_cert: &MembershipCertificate, ) -> AuthStateEvent
Notify the monitor that re-authentication succeeded.
Call this after a new certificate is obtained.
Sourcepub fn current_state(&self) -> Option<&CertificateState>
pub fn current_state(&self) -> Option<&CertificateState>
Get the current state without triggering events.
Trait Implementations§
Source§impl Clone for AuthStateMonitor
impl Clone for AuthStateMonitor
Source§fn clone(&self) -> AuthStateMonitor
fn clone(&self) -> AuthStateMonitor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthStateMonitor
impl RefUnwindSafe for AuthStateMonitor
impl Send for AuthStateMonitor
impl Sync for AuthStateMonitor
impl Unpin for AuthStateMonitor
impl UnsafeUnpin for AuthStateMonitor
impl UnwindSafe for AuthStateMonitor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more