pub struct SecurityHeadersLayer { /* private fields */ }Expand description
Tower layer that applies secure response headers.
Implementations§
Source§impl SecurityHeadersLayer
impl SecurityHeadersLayer
Sourcepub fn new(
config: &SecurityHeadersConfig,
) -> Result<SecurityHeadersLayer, AppError>
pub fn new( config: &SecurityHeadersConfig, ) -> Result<SecurityHeadersLayer, AppError>
Create a new layer from validated configuration.
§Errors
Returns an error when the configuration is invalid or a header value cannot be constructed.
Trait Implementations§
Source§impl Clone for SecurityHeadersLayer
impl Clone for SecurityHeadersLayer
Source§fn clone(&self) -> SecurityHeadersLayer
fn clone(&self) -> SecurityHeadersLayer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecurityHeadersLayer
impl Debug for SecurityHeadersLayer
Source§impl<S> Layer<S> for SecurityHeadersLayer
impl<S> Layer<S> for SecurityHeadersLayer
Source§type Service = SecurityHeadersService<S>
type Service = SecurityHeadersService<S>
The wrapped service
Auto Trait Implementations§
impl Freeze for SecurityHeadersLayer
impl RefUnwindSafe for SecurityHeadersLayer
impl Send for SecurityHeadersLayer
impl Sync for SecurityHeadersLayer
impl Unpin for SecurityHeadersLayer
impl UnsafeUnpin for SecurityHeadersLayer
impl UnwindSafe for SecurityHeadersLayer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request