Skip to main content

ErasedGuard

Trait ErasedGuard 

Source
pub trait ErasedGuard<T: Transport>:
    Send
    + Sync
    + 'static {
    // Required methods
    fn can_activate<'a>(
        &'a self,
        cx: &'a T::Cx,
    ) -> BoxFuture<'a, Result<bool, BoxError>>;
    fn name(&self) -> &'static str;
}
Expand description

The dyn-compatible twin of Guard, implemented for every guard; its trait object is the role key AnyGuard.

Required Methods§

Source

fn can_activate<'a>( &'a self, cx: &'a T::Cx, ) -> BoxFuture<'a, Result<bool, BoxError>>

Source

fn name(&self) -> &'static str

The guard’s type name, which a refusal reports as GuardRejected::guard.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Transport, G: Guard<T>> ErasedGuard<T> for G