Struct ServerOptions
pub struct ServerOptions {
pub max_params_bytes: usize,
pub max_stdin_bytes: Option<u64>,
pub max_data_bytes: Option<u64>,
pub read_timeout: Option<Duration>,
pub write_timeout: Option<Duration>,
pub max_requests_per_connection: Option<u64>,
pub strict_begin_body_size: bool,
pub respond_cant_mpx_conn: bool,
}fastcgi only.Expand description
Configuration for FastCgiServer.
Fields§
§max_params_bytes: usizeMaximum total bytes accepted across all FCGI_PARAMS records for a
single request. Excess data terminates the connection with a protocol
error.
Default: 1 MiB.
max_stdin_bytes: Option<u64>Optional total cap on bytes accepted across all FCGI_STDIN records.
None means unbounded (defer enforcement to the inner service).
Default: None.
max_data_bytes: Option<u64>Optional total cap on bytes accepted across all FCGI_DATA records
(Filter role only). None means unbounded.
Default: None.
read_timeout: Option<Duration>Optional idle timeout applied to the wrapped IO’s read side, enforced
via rama_core::io::timeout::TimeoutIo. Catches slow-loris clients
that hold a connection open without progressing the request.
Default: Some(30s). Set to None to disable.
write_timeout: Option<Duration>Optional write timeout applied to the wrapped IO’s write side.
Default: Some(30s). Set to None to disable.
max_requests_per_connection: Option<u64>Maximum number of requests served over a single keep-alive connection
before the server unilaterally closes it. None means unlimited (the
peer decides via keep_conn=0). Useful to bound resource pinning
from a single peer.
Default: Some(1024). Set to None to disable.
strict_begin_body_size: boolReject FCGI_BEGIN_REQUEST bodies whose content length differs from
the canonical 8. By default the server tolerates content_length >= 8
and ignores the extras (forward-compat with hypothetical extensions).
Default: false.
respond_cant_mpx_conn: boolWhen a record arrives for a different request id while a request is
in flight, reply with FCGI_END_REQUEST{CantMpxConn} for that id and
continue serving the current request. When disabled, the server still
behaves gracefully (drops the stray record) but does not signal the
peer.
Default: true.
Implementations§
§impl ServerOptions
impl ServerOptions
pub fn new() -> ServerOptions
pub fn new() -> ServerOptions
Create a new ServerOptions with default values.
pub fn with_max_params_bytes(self, n: usize) -> ServerOptions
pub fn with_max_params_bytes(self, n: usize) -> ServerOptions
Maximum total bytes accepted across all FCGI_PARAMS records.
pub fn set_max_params_bytes(&mut self, n: usize) -> &mut ServerOptions
pub fn set_max_params_bytes(&mut self, n: usize) -> &mut ServerOptions
Maximum total bytes accepted across all FCGI_PARAMS records.
pub fn maybe_with_max_stdin_bytes(self, n: Option<u64>) -> ServerOptions
pub fn maybe_with_max_stdin_bytes(self, n: Option<u64>) -> ServerOptions
Maximum total bytes accepted across all FCGI_STDIN records.
Set to None for unbounded.
pub fn maybe_set_max_stdin_bytes(
&mut self,
n: Option<u64>,
) -> &mut ServerOptions
pub fn maybe_set_max_stdin_bytes( &mut self, n: Option<u64>, ) -> &mut ServerOptions
Maximum total bytes accepted across all FCGI_STDIN records.
Set to None for unbounded.
pub fn with_max_stdin_bytes(self, n: u64) -> ServerOptions
pub fn with_max_stdin_bytes(self, n: u64) -> ServerOptions
Maximum total bytes accepted across all FCGI_STDIN records.
Set to None for unbounded.
pub fn set_max_stdin_bytes(&mut self, n: u64) -> &mut ServerOptions
pub fn set_max_stdin_bytes(&mut self, n: u64) -> &mut ServerOptions
Maximum total bytes accepted across all FCGI_STDIN records.
Set to None for unbounded.
pub fn without_max_stdin_bytes(self) -> ServerOptions
pub fn without_max_stdin_bytes(self) -> ServerOptions
Maximum total bytes accepted across all FCGI_STDIN records.
Set to None for unbounded.
pub fn unset_max_stdin_bytes(&mut self) -> &mut ServerOptions
pub fn unset_max_stdin_bytes(&mut self) -> &mut ServerOptions
Maximum total bytes accepted across all FCGI_STDIN records.
Set to None for unbounded.
pub fn maybe_with_max_data_bytes(self, n: Option<u64>) -> ServerOptions
pub fn maybe_with_max_data_bytes(self, n: Option<u64>) -> ServerOptions
Maximum total bytes accepted across all FCGI_DATA records
(Filter role only). None means unbounded.
pub fn maybe_set_max_data_bytes(&mut self, n: Option<u64>) -> &mut ServerOptions
pub fn maybe_set_max_data_bytes(&mut self, n: Option<u64>) -> &mut ServerOptions
Maximum total bytes accepted across all FCGI_DATA records
(Filter role only). None means unbounded.
pub fn with_max_data_bytes(self, n: u64) -> ServerOptions
pub fn with_max_data_bytes(self, n: u64) -> ServerOptions
Maximum total bytes accepted across all FCGI_DATA records
(Filter role only). None means unbounded.
pub fn set_max_data_bytes(&mut self, n: u64) -> &mut ServerOptions
pub fn set_max_data_bytes(&mut self, n: u64) -> &mut ServerOptions
Maximum total bytes accepted across all FCGI_DATA records
(Filter role only). None means unbounded.
pub fn without_max_data_bytes(self) -> ServerOptions
pub fn without_max_data_bytes(self) -> ServerOptions
Maximum total bytes accepted across all FCGI_DATA records
(Filter role only). None means unbounded.
pub fn unset_max_data_bytes(&mut self) -> &mut ServerOptions
pub fn unset_max_data_bytes(&mut self) -> &mut ServerOptions
Maximum total bytes accepted across all FCGI_DATA records
(Filter role only). None means unbounded.
pub fn maybe_with_read_timeout(self, d: Option<Duration>) -> ServerOptions
pub fn maybe_with_read_timeout(self, d: Option<Duration>) -> ServerOptions
Optional idle read timeout enforced at the IO layer.
pub fn maybe_set_read_timeout(
&mut self,
d: Option<Duration>,
) -> &mut ServerOptions
pub fn maybe_set_read_timeout( &mut self, d: Option<Duration>, ) -> &mut ServerOptions
Optional idle read timeout enforced at the IO layer.
pub fn with_read_timeout(self, d: Duration) -> ServerOptions
pub fn with_read_timeout(self, d: Duration) -> ServerOptions
Optional idle read timeout enforced at the IO layer.
pub fn set_read_timeout(&mut self, d: Duration) -> &mut ServerOptions
pub fn set_read_timeout(&mut self, d: Duration) -> &mut ServerOptions
Optional idle read timeout enforced at the IO layer.
pub fn without_read_timeout(self) -> ServerOptions
pub fn without_read_timeout(self) -> ServerOptions
Optional idle read timeout enforced at the IO layer.
pub fn unset_read_timeout(&mut self) -> &mut ServerOptions
pub fn unset_read_timeout(&mut self) -> &mut ServerOptions
Optional idle read timeout enforced at the IO layer.
pub fn maybe_with_write_timeout(self, d: Option<Duration>) -> ServerOptions
pub fn maybe_with_write_timeout(self, d: Option<Duration>) -> ServerOptions
Optional write timeout enforced at the IO layer.
pub fn maybe_set_write_timeout(
&mut self,
d: Option<Duration>,
) -> &mut ServerOptions
pub fn maybe_set_write_timeout( &mut self, d: Option<Duration>, ) -> &mut ServerOptions
Optional write timeout enforced at the IO layer.
pub fn with_write_timeout(self, d: Duration) -> ServerOptions
pub fn with_write_timeout(self, d: Duration) -> ServerOptions
Optional write timeout enforced at the IO layer.
pub fn set_write_timeout(&mut self, d: Duration) -> &mut ServerOptions
pub fn set_write_timeout(&mut self, d: Duration) -> &mut ServerOptions
Optional write timeout enforced at the IO layer.
pub fn without_write_timeout(self) -> ServerOptions
pub fn without_write_timeout(self) -> ServerOptions
Optional write timeout enforced at the IO layer.
pub fn unset_write_timeout(&mut self) -> &mut ServerOptions
pub fn unset_write_timeout(&mut self) -> &mut ServerOptions
Optional write timeout enforced at the IO layer.
pub fn maybe_with_max_requests_per_connection(
self,
n: Option<u64>,
) -> ServerOptions
pub fn maybe_with_max_requests_per_connection( self, n: Option<u64>, ) -> ServerOptions
Maximum requests served per keep-alive connection. None means
unlimited; the peer decides via keep_conn.
pub fn maybe_set_max_requests_per_connection(
&mut self,
n: Option<u64>,
) -> &mut ServerOptions
pub fn maybe_set_max_requests_per_connection( &mut self, n: Option<u64>, ) -> &mut ServerOptions
Maximum requests served per keep-alive connection. None means
unlimited; the peer decides via keep_conn.
pub fn with_max_requests_per_connection(self, n: u64) -> ServerOptions
pub fn with_max_requests_per_connection(self, n: u64) -> ServerOptions
Maximum requests served per keep-alive connection. None means
unlimited; the peer decides via keep_conn.
pub fn set_max_requests_per_connection(&mut self, n: u64) -> &mut ServerOptions
pub fn set_max_requests_per_connection(&mut self, n: u64) -> &mut ServerOptions
Maximum requests served per keep-alive connection. None means
unlimited; the peer decides via keep_conn.
pub fn without_max_requests_per_connection(self) -> ServerOptions
pub fn without_max_requests_per_connection(self) -> ServerOptions
Maximum requests served per keep-alive connection. None means
unlimited; the peer decides via keep_conn.
pub fn unset_max_requests_per_connection(&mut self) -> &mut ServerOptions
pub fn unset_max_requests_per_connection(&mut self) -> &mut ServerOptions
Maximum requests served per keep-alive connection. None means
unlimited; the peer decides via keep_conn.
pub fn with_strict_begin_body_size(self, on: bool) -> ServerOptions
pub fn with_strict_begin_body_size(self, on: bool) -> ServerOptions
Reject non-canonical FCGI_BEGIN_REQUEST body sizes.
pub fn set_strict_begin_body_size(&mut self, on: bool) -> &mut ServerOptions
pub fn set_strict_begin_body_size(&mut self, on: bool) -> &mut ServerOptions
Reject non-canonical FCGI_BEGIN_REQUEST body sizes.
pub fn with_respond_cant_mpx_conn(self, on: bool) -> ServerOptions
pub fn with_respond_cant_mpx_conn(self, on: bool) -> ServerOptions
Whether to reply with FCGI_CANT_MPX_CONN for a second concurrent
FCGI_BEGIN_REQUEST on the same connection.
pub fn set_respond_cant_mpx_conn(&mut self, on: bool) -> &mut ServerOptions
pub fn set_respond_cant_mpx_conn(&mut self, on: bool) -> &mut ServerOptions
Whether to reply with FCGI_CANT_MPX_CONN for a second concurrent
FCGI_BEGIN_REQUEST on the same connection.
Trait Implementations§
§impl Clone for ServerOptions
impl Clone for ServerOptions
§fn clone(&self) -> ServerOptions
fn clone(&self) -> ServerOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ServerOptions
impl Debug for ServerOptions
§impl Default for ServerOptions
impl Default for ServerOptions
§fn default() -> ServerOptions
fn default() -> ServerOptions
Auto Trait Implementations§
impl Freeze for ServerOptions
impl RefUnwindSafe for ServerOptions
impl Send for ServerOptions
impl Sync for ServerOptions
impl Unpin for ServerOptions
impl UnsafeUnpin for ServerOptions
impl UnwindSafe for ServerOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writer§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writer§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writer§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writer§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer