pub struct ServerSecurity { /* private fields */ }Expand description
Shared by the listener and router. A request pins one complete generation.
Implementations§
Source§impl ServerSecurity
impl ServerSecurity
Sourcepub fn new(
policy: SecurityPolicy,
tls: Option<TlsConfig>,
) -> Result<Arc<Self>, SecurityError>
pub fn new( policy: SecurityPolicy, tls: Option<TlsConfig>, ) -> Result<Arc<Self>, SecurityError>
Publishes the first generation and fixes the transport mode: TLS if
tls is present, plaintext otherwise. replace
cannot change that mode later.
§Errors
Returns a SecurityError if policy maps client certificates but
tls is absent or has no client CA.
Sourcepub fn replace(
&self,
policy: SecurityPolicy,
tls: Option<TlsConfig>,
) -> Result<(), SecurityError>
pub fn replace( &self, policy: SecurityPolicy, tls: Option<TlsConfig>, ) -> Result<(), SecurityError>
Existing connections consult the new role map on their next request. Changing transport mode requires restarting the listener; TLS cannot be removed by a credential reload on an exposed listener.
Auto Trait Implementations§
impl !Freeze for ServerSecurity
impl !RefUnwindSafe for ServerSecurity
impl !UnwindSafe for ServerSecurity
impl Send for ServerSecurity
impl Sync for ServerSecurity
impl Unpin for ServerSecurity
impl UnsafeUnpin for ServerSecurity
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