Skip to main content

ServerBuilder

Struct ServerBuilder 

Source
pub struct ServerBuilder<'a>
where TlsSettings: Describe,
{ /* private fields */ }
Expand description

Builds a Built from its settings, filled in layers, and the inputs it takes. build lists everything still missing at once.

Implementations§

Source§

impl<'a> ServerBuilder<'a>
where TlsSettings: Describe,

Source

pub fn identity(self, value: impl Into<&'a Identity>) -> Self

Sets the input identity; the last call wins.

Source

pub fn client_auth(self, value: impl Into<ClientAuth>) -> Self

Sets the input client_auth; the last call wins.

Source

pub fn fill(self, partial: Partial<TlsSettings>) -> Self

Lays partial over what is set: only the keys it sets are taken, and the last write of a key wins.

Source

pub fn fill_from(self, source: &mut impl Source) -> Result<Self, FillError>

Fills the settings from source, in turn after what is already set. The keys the source holds that the settings lack are dropped; to see them, fill a Partial and pass it to fill.

§Errors

The FillError that Partial::fill_from gives.

Source

pub fn parts(self) -> Result<ServerParts<'a>, Missing>

The parts: the settings built, every required input present and every optional input as given. A second terminal (one that builds a different value from the same parts) is written over this.

§Errors

Everything that is missing, at once: the same Missing that build gives.

Source

pub fn build( self, ) -> Result<Built<ServerConfig>, BuildError<<Built<ServerConfig> as TryFrom<ServerParts<'a>>>::Error>>

The built value, or everything that is missing: every required setting and every required input, at once.

§Errors

What is missing, or for a fallible build the error of the conversion.

Source§

impl<'a> ServerBuilder<'a>
where TlsSettings: Describe,

Source

pub fn new() -> Self

A builder with nothing set.

Source§

impl<'a> ServerBuilder<'a>
where TlsSettings: Describe,

Source

pub fn non_defaults(&self) -> Vec<NonDefault>

Every setting that differs from its default, as the builder would build it.

Source§

impl ServerBuilder<'_>

Source

pub fn configs(self) -> Result<ServerConfigs, BuildError<PeerError>>

The configurations of a listener, one per connection: for a host such as quinn, whose connections reach rustls without this crate’s accept helpers. See ServerConfigs.

§Errors

As build.

Source§

impl<'a> ServerBuilder<'a>
where Self: Holds<TlsSettings>,

Source

pub fn alpn(self, value: impl Into<Vec<Alpn>>) -> Self

The application protocols offered, most preferred first, as text (h2, coqui/1), each 1 to 255 bytes.

Source

pub fn policy(self, value: impl Into<Policy>) -> Self

The policy configurations are built under.

Trait Implementations§

Source§

impl<'a> Check<ServerBuilder<'a>> for Profile
where TlsSettings: Describe,

Source§

fn check(&self, subject: &ServerBuilder<'a>, report: &mut Report)

Judges subject, pushing a Finding per expectation.
Source§

impl<'a> Configured for ServerBuilder<'a>
where TlsSettings: Describe,

Source§

type Settings = TlsSettings

The type of the settings.
Source§

fn configured(&self) -> &dyn Inspect

The settings, read through [Inspect].
§

fn non_defaults(&self) -> Vec<NonDefault>

Every setting that differs from its default.
Source§

impl<'a> Debug for ServerBuilder<'a>
where TlsSettings: Describe,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for ServerBuilder<'a>
where TlsSettings: Describe,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> From<Partial<TlsSettings>> for ServerBuilder<'a>
where TlsSettings: Describe,

Source§

fn from(partial: Partial<TlsSettings>) -> Self

Converts to this type from the input type.
Source§

impl<'a> Holds<TlsSettings> for ServerBuilder<'a>
where TlsSettings: Describe,

Source§

fn partial_mut(&mut self) -> &mut Partial<TlsSettings>

The settings being filled.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ServerBuilder<'a>

§

impl<'a> !UnwindSafe for ServerBuilder<'a>

§

impl<'a> Freeze for ServerBuilder<'a>

§

impl<'a> Send for ServerBuilder<'a>

§

impl<'a> Sync for ServerBuilder<'a>

§

impl<'a> Unpin for ServerBuilder<'a>

§

impl<'a> UnsafeUnpin for ServerBuilder<'a>

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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, 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<__B> TlsSettingsSetters for __B
where __B: Holds<TlsSettings>,

Source§

fn alpn(self, value: impl Into<Vec<Alpn>>) -> __B

The application protocols offered, most preferred first, as text (h2, coqui/1), each 1 to 255 bytes.
Source§

fn policy(self, value: impl Into<Policy>) -> __B

The policy configurations are built under.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.