pub struct CorsPlugin { /* private fields */ }Expand description
Process-wide CorsPlugin singleton holding a precompiled CompiledCors policy.
Implementations§
Source§impl CorsPlugin
Inherent implementation of CorsPlugin.
impl CorsPlugin
Inherent implementation of CorsPlugin.
Sourcepub fn init(config: CorsConfig) -> &'static Self
pub fn init(config: CorsConfig) -> &'static Self
Initializes the global CorsPlugin once with config.
§Arguments
CorsConfig- CORS policy configuration.
§Returns
&'static Self- Reference to the initialized global plugin.
Sourcepub fn get() -> Option<&'static Self>
pub fn get() -> Option<&'static Self>
Returns the initialized global CorsPlugin, if CorsPlugin::init was called.
§Returns
Option<&'static Self>- Global plugin reference, orNone.
Sourcepub fn get_compiled(&self) -> &CompiledCors
pub fn get_compiled(&self) -> &CompiledCors
Trait Implementations§
Source§impl Clone for CorsPlugin
impl Clone for CorsPlugin
Auto Trait Implementations§
impl !RefUnwindSafe for CorsPlugin
impl !UnwindSafe for CorsPlugin
impl Forget for CorsPlugin
impl Freeze for CorsPluginwhere
PhantomData<fn() -> XxHash3_64>: Freeze,
*const u8 is !null: Freeze,
PhantomData<(String, ())>: Freeze,
PhantomData<String>: Freeze,
*const ArcInner<dyn Fn(&str) -> bool + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&str) -> bool + Sync + Send>>: Freeze,
*const [String] is !null: Freeze,
PhantomData<[String]>: Freeze,
PhantomData<u8>: Freeze,
*const [u8] is !null: Freeze,
PhantomData<[u8]>: Freeze,
impl Move for CorsPlugin
impl Send for CorsPlugin
impl Sync for CorsPlugin
impl Unpin for CorsPlugin
impl UnsafeUnpin for CorsPluginwhere
PhantomData<fn() -> XxHash3_64>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, ())>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<dyn Fn(&str) -> bool + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&str) -> bool + Sync + Send>>: UnsafeUnpin,
*const [String] is !null: UnsafeUnpin,
PhantomData<[String]>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const [u8] is !null: UnsafeUnpin,
PhantomData<[u8]>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone 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