#[non_exhaustive]pub struct RelayConfig {
pub http_bind_addr: SocketAddr,
pub tls: Option<TlsConfig>,
pub limits: Limits,
pub key_cache_capacity: Option<usize>,
pub access: Arc<dyn DynAccessControl>,
}server only.Expand description
Configuration for the Relay HTTP and HTTPS server.
This includes the HTTP services hosted by the Relay server, the Relay /relay HTTP
endpoint is only one of the services served.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.http_bind_addr: SocketAddrThe socket address on which the Relay HTTP server should bind.
Normally you’d choose port 80. The bind address for the HTTPS server is
configured in RelayConfig::tls.
If RelayConfig::tls is None then this serves all the HTTP services without
TLS.
tls: Option<TlsConfig>TLS configuration for the HTTPS server.
If None all the HTTP services that would be served here are served from
RelayConfig::http_bind_addr.
limits: LimitsRate limits.
key_cache_capacity: Option<usize>Key cache capacity.
access: Arc<dyn DynAccessControl>Access control for incoming connections.
Implementations§
Source§impl RelayConfig
impl RelayConfig
Sourcepub fn new(http_bind_addr: impl Into<SocketAddr>) -> Self
pub fn new(http_bind_addr: impl Into<SocketAddr>) -> Self
Creates a new RelayConfig bound to http_bind_addr with default settings.
TLS is disabled, default Limits are used, the key cache capacity is unset, and
access defaults to AllowAll. Adjust any of these by assigning to the
corresponding fields after construction.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RelayConfig
impl !RefUnwindSafe for RelayConfig
impl Send for RelayConfig
impl Sync for RelayConfig
impl Unpin for RelayConfig
impl !UnwindSafe for RelayConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more