pub struct GuardBuilder<St, S = Uuid> { /* private fields */ }Expand description
Builds a Guard. Start with Guard::builder.
Implementations§
Source§impl<St: SessionStore, S: Subject> GuardBuilder<St, S>
impl<St: SessionStore, S: Subject> GuardBuilder<St, S>
Sourcepub fn subject<T: Subject>(self) -> GuardBuilder<St, T>
pub fn subject<T: Subject>(self) -> GuardBuilder<St, T>
Uses T as the subject type.
Sourcepub fn ip_intel(self, intel: impl IpIntel) -> Self
pub fn ip_intel(self, intel: impl IpIntel) -> Self
Country / ASN source. Without one, IP changes are judged by network prefix only.
Sourcepub fn on_event(
self,
hook: impl Fn(&SessionEvent) + Send + Sync + 'static,
) -> Self
pub fn on_event( self, hook: impl Fn(&SessionEvent) + Send + Sync + 'static, ) -> Self
Called synchronously for every recorded event, after it is stored. Keep it fast; a panic in the hook is caught and logged.
Sourcepub fn clock(self, clock: impl Clock) -> Self
pub fn clock(self, clock: impl Clock) -> Self
Time source (default SystemClock).
Auto Trait Implementations§
impl<St, S = Uuid> !RefUnwindSafe for GuardBuilder<St, S>
impl<St, S = Uuid> !UnwindSafe for GuardBuilder<St, S>
impl<St, S> Freeze for GuardBuilder<St, S>
impl<St, S> Send for GuardBuilder<St, S>
impl<St, S> Sync for GuardBuilder<St, S>
impl<St, S> Unpin for GuardBuilder<St, S>
impl<St, S> UnsafeUnpin for GuardBuilder<St, S>
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> 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