pub struct EtagPlugin { /* private fields */ }Expand description
Precompiled ETag engine backing EtagRequestHook and EtagResponseHook.
Implementations§
Source§impl EtagPlugin
Request precondition and response conditional evaluation methods for EtagPlugin.
impl EtagPlugin
Request precondition and response conditional evaluation methods for EtagPlugin.
Sourcepub fn new(
config: EtagConfig,
validator: Option<Arc<dyn EtagValidator>>,
) -> Self
pub fn new( config: EtagConfig, validator: Option<Arc<dyn EtagValidator>>, ) -> Self
Compiles a standalone EtagPlugin with an optional EtagValidator.
§Arguments
EtagConfig- ETag configuration.Option<Arc<dyn EtagValidator>>- Optional validator forIf-Matchchecks.
§Returns
Self- Compiled plugin.
Sourcepub fn init(config: EtagConfig) -> &'static Self
pub fn init(config: EtagConfig) -> &'static Self
Initializes the global EtagPlugin singleton once.
§Arguments
EtagConfig- ETag configuration.
§Returns
&'static Self- Reference to the global plugin.
Sourcepub fn init_with_validator(
config: EtagConfig,
validator: Arc<dyn EtagValidator>,
) -> &'static Self
pub fn init_with_validator( config: EtagConfig, validator: Arc<dyn EtagValidator>, ) -> &'static Self
Initializes the global EtagPlugin singleton with a custom EtagValidator.
§Arguments
EtagConfig- ETag configuration.Arc<dyn EtagValidator>- Optimistic concurrency validator.
§Returns
&'static Self- Reference to the global plugin.
Sourcepub fn get() -> Option<&'static Self>
pub fn get() -> Option<&'static Self>
Returns the initialized global EtagPlugin, if configured.
§Returns
Option<&'static Self>- Reference to the global plugin, orNone.
Sourcepub fn check_if_match(&self, request: &Request) -> bool
pub fn check_if_match(&self, request: &Request) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for EtagPlugin
impl !UnwindSafe for EtagPlugin
impl Forget for EtagPlugin
impl Freeze for EtagPluginwhere
*const u8 is !null: Freeze,
PhantomData<String>: Freeze,
*const [String] is !null: Freeze,
PhantomData<[String]>: Freeze,
*const ArcInner<dyn EtagValidator> is !null: Freeze,
PhantomData<ArcInner<dyn EtagValidator>>: Freeze,
PhantomData<u8>: Freeze,
impl Move for EtagPlugin
impl Send for EtagPlugin
impl Sync for EtagPlugin
impl Unpin for EtagPlugin
impl UnsafeUnpin for EtagPluginwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const [String] is !null: UnsafeUnpin,
PhantomData<[String]>: UnsafeUnpin,
*const ArcInner<dyn EtagValidator> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn EtagValidator>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendSync for T
impl<T> AnySync for T
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