Skip to main content

ServerFrameworkBuilder

Struct ServerFrameworkBuilder 

Source
pub struct ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA> { /* private fields */ }
Available on crate features http and http-server-framework only.
Expand description

Server

Implementations§

Source§

impl<CA, CBP, E, EN, M, S, SA> ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA>
where CA: ConnAux, SA: StreamAux,

Source

pub fn new(cbp: CBP, router: Router<CA, E, EN, M, S, SA>) -> Self

New instance with default connection values.

Source

pub const fn enable_connect_protocol(self, elem: bool) -> Self

Maximum number of active concurrent streams

Source

pub fn with_aux<CACB, SACB>( self, ca_cb: CACB, sa_cb: SACB, ) -> ServerFramework<CA, CACB, CBP, E, EN, M, S, SA, SACB>
where CACB: Fn(CBP) -> Result<CA::Init, E>, SACB: Fn(&mut CA) -> Result<SA::Init, E>,

Sets the initialization structures for both CA and SA.

Source

pub fn with_dflt_aux( self, ) -> ServerFramework<CA, fn(CBP) -> CA::Init, CBP, E, EN, M, S, SA, fn(&mut CA) -> SA::Init>
where CA::Init: Default, SA::Init: Default,

Fills the initialization structures for all auxiliaries with default values.

Source

pub const fn initial_window_len(self, elem: u32) -> Self

The initial amount of “credit” a counterpart can have for sending data.

Source

pub const fn max_body_len(self, elem: u32) -> Self

The maximum number of data bytes or the sum of all frames that composed the body data.

Source

pub const fn max_concurrent_streams_num(self, elem: u32) -> Self

Maximum number of active concurrent streams

Source

pub const fn max_frame_len(self, elem: u32) -> Self

Maximum frame payload length

Source

pub const fn max_hpack_len(self, elem: (u32, u32)) -> Self

Maximum HPACK length

Indicates the maximum length of the HPACK structure that holds cached decoded headers received from a counterpart.

  • The first parameter indicates the local HPACK decoder length that is externally advertised and can become the remote HPACK encoder length.
  • The second parameter indicates the maximum local HPACK encoder length. In other words, it doesn’t allow external actors to dictate very large lengths.
Source

pub const fn max_headers_len(self, elem: u32) -> Self

The maximum number of bytes of the entire set of headers in a request/response.

Source

pub const fn max_recv_streams_num(self, elem: u32) -> Self

Maximum number of receiving streams

Servers only. Prevents clients from opening more than the specified number of streams.

Source§

impl<CBP, E, EN, M, S> ServerFrameworkBuilder<(), CBP, E, EN, M, S, ()>

Source

pub fn without_aux( self, ) -> ServerFramework<(), fn(CBP) -> Result<(), E>, CBP, E, EN, M, S, (), fn(&mut ()) -> Result<(), E>>

Build without state

Source§

impl<CA, CBP, E, EN, M, S> ServerFrameworkBuilder<CA, CBP, E, EN, M, S, ()>
where CA: ConnAux,

Source

pub fn with_conn_aux<CACB>( self, ca_cb: CACB, ) -> ServerFramework<CA, CACB, CBP, E, EN, M, S, (), fn(&mut CA) -> Result<(), E>>
where CACB: Fn(CBP) -> Result<CA::Init, E>,

Sets the initializing strut for CA and sets the request auxiliary to ().

Source§

impl<CBP, E, EN, M, S, SA> ServerFrameworkBuilder<(), CBP, E, EN, M, S, SA>
where SA: StreamAux,

Source

pub fn with_stream_aux<SACB>( self, ra_cb: SACB, ) -> ServerFramework<(), fn(CBP) -> Result<(), E>, CBP, E, EN, M, S, SA, SACB>
where SACB: Fn(&mut ()) -> Result<SA::Init, E>,

Sets the initializing strut for SA and sets the connection auxiliary to ().

Trait Implementations§

Source§

impl<CA: Debug, CBP: Debug, E: Debug, EN: Debug, M: Debug, S: Debug, SA: Debug> Debug for ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<CA, CBP, E, EN, M, S, SA> Freeze for ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA>
where CBP: Freeze,

§

impl<CA, CBP, E, EN, M, S, SA> !RefUnwindSafe for ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA>

§

impl<CA, CBP, E, EN, M, S, SA> Send for ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA>
where CBP: Send, EN: Sync + Send, M: Sync + Send, CA: Sync + Send, E: Sync + Send, S: Sync + Send, SA: Sync + Send,

§

impl<CA, CBP, E, EN, M, S, SA> Sync for ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA>
where CBP: Sync, EN: Sync + Send, M: Sync + Send, CA: Sync + Send, E: Sync + Send, S: Sync + Send, SA: Sync + Send,

§

impl<CA, CBP, E, EN, M, S, SA> Unpin for ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA>
where CBP: Unpin,

§

impl<CA, CBP, E, EN, M, S, SA> !UnwindSafe for ServerFrameworkBuilder<CA, CBP, E, EN, M, S, SA>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more