Struct tx5::DefConfig

source ·
pub struct DefConfig { /* private fields */ }
Expand description

Builder type for constructing a DefConfig for a Tx5 endpoint.

Implementations§

source§

impl DefConfig

source

pub fn set_max_send_bytes(&mut self, max_send_bytes: u32)

Set the max queued send bytes to hold before applying backpressure. The default is 16 * 1024 * 1024.

source

pub fn with_max_send_bytes(self, max_send_bytes: u32) -> Self

See set_max_send_bytes(), this is the builder version.

source

pub fn set_max_recv_bytes(&mut self, max_recv_bytes: u32)

Set the max queued recv bytes to hold before dropping connection. The default is 16 * 1024 * 1024.

source

pub fn with_max_recv_bytes(self, max_recv_bytes: u32) -> Self

See set_max_recv_bytes(), this is the builder version.

source

pub fn set_max_conn_count(&mut self, max_conn_count: u32)

Set the max concurrent connection count. The default is 255.

source

pub fn with_max_conn_count(self, max_conn_count: u32) -> Self

See set_max_conn_count(), this is the builder version.

source

pub fn set_max_conn_init(&mut self, max_conn_init: Duration)

Set the max connection init (connect) time. The default is 60 seconds.

source

pub fn with_max_conn_init(self, max_conn_init: Duration) -> Self

See set_max_conn_init(), this is the builder version.

source

pub fn set_metrics(&mut self, metrics: Registry)

Set the prometheus metrics registry to use. The default is the global static default registry.

source

pub fn with_metrics(self, metrics: Registry) -> Self

See set_metrics(), this is the builder version.

source

pub fn set_lair_client(&mut self, lair_client: LairClient)

Set the lair client. The default is a generated in-process, in-memory only keystore.

source

pub fn with_lair_client(self, lair_client: LairClient) -> Self

See set_lair_client(), this is the builder version.

source

pub fn set_lair_tag(&mut self, lair_tag: Arc<str>)

Set the lair tag used to identify the signing identity keypair. The default is a random 32 byte utf8 string.

source

pub fn with_lair_tag(self, lair_tag: Arc<str>) -> Self

See set_lair_tag(), this is the builder version.

source

pub fn set_new_sig_cb<Cb>(&mut self, cb: Cb)where Cb: Fn(DynConfig, Tx5Url, SigStateSeed) + 'static + Send + Sync,

Override the default new signal connection request handler. The default uses the default tx5-signal dependency.

source

pub fn with_new_sig_cb<Cb>(self, cb: Cb) -> Selfwhere Cb: Fn(DynConfig, Tx5Url, SigStateSeed) + 'static + Send + Sync,

See set_new_sig_cb(), this is the builder version.

source

pub fn set_new_conn_cb<Cb>(&mut self, cb: Cb)where Cb: Fn(DynConfig, Arc<Value>, ConnStateSeed) + 'static + Send + Sync,

Override the default new peer connection request handler. The default uses either tx5-go-pion, or rust-webrtc depending on the feature flipper chosen at compile time.

source

pub fn with_new_conn_cb<Cb>(self, cb: Cb) -> Selfwhere Cb: Fn(DynConfig, Arc<Value>, ConnStateSeed) + 'static + Send + Sync,

See set_new_conn_cb(), this is the builder version.

Trait Implementations§

source§

impl Default for DefConfig

source§

fn default() -> DefConfig

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

impl IntoConfig for DefConfig

source§

fn into_config(self) -> BoxFut<'static, Result<DynConfig>>

Convert this type into a concrete config type.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · 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 Twhere U: From<T>,

const: unstable · 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<T> for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

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