Trait CorsService

Source
pub trait CorsService:
    Send
    + Sync
    + Sized
    + 'static
    + Send {
    // Required methods
    fn allowed_origins(&self) -> &[String];
    fn build_cors_layer(&self) -> Result<CorsLayer>;
}
Expand description

CORS service

Required Methods§

Source

fn allowed_origins(&self) -> &[String]

Retrieves the allowed origins for this API

Source

fn build_cors_layer(&self) -> Result<CorsLayer>

Builds the CorsLayer

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: CorsService + ?Sized> CorsService for Box<T>
where Box<T>: Send + Sync + Sized + 'static,

Source§

impl<T: CorsService + ?Sized> CorsService for Arc<T>
where Arc<T>: Send + Sync + Sized + 'static,

Implementors§