pub struct DefConfig { /* private fields */ }Expand description
Builder type for constructing a DefConfig for a Tx5 endpoint.
Implementations§
source§impl DefConfig
impl DefConfig
sourcepub fn set_max_send_bytes(&mut self, max_send_bytes: u32)
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.
sourcepub fn with_max_send_bytes(self, max_send_bytes: u32) -> Self
pub fn with_max_send_bytes(self, max_send_bytes: u32) -> Self
See set_max_send_bytes(), this is the builder version.
sourcepub fn set_max_recv_bytes(&mut self, max_recv_bytes: u32)
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.
sourcepub fn with_max_recv_bytes(self, max_recv_bytes: u32) -> Self
pub fn with_max_recv_bytes(self, max_recv_bytes: u32) -> Self
See set_max_recv_bytes(), this is the builder version.
sourcepub fn set_max_conn_count(&mut self, max_conn_count: u32)
pub fn set_max_conn_count(&mut self, max_conn_count: u32)
Set the max concurrent connection count.
The default is 255.
sourcepub fn with_max_conn_count(self, max_conn_count: u32) -> Self
pub fn with_max_conn_count(self, max_conn_count: u32) -> Self
See set_max_conn_count(), this is the builder version.
sourcepub fn set_max_conn_init(&mut self, max_conn_init: Duration)
pub fn set_max_conn_init(&mut self, max_conn_init: Duration)
Set the max connection init (connect) time.
The default is 60 seconds.
sourcepub fn with_max_conn_init(self, max_conn_init: Duration) -> Self
pub fn with_max_conn_init(self, max_conn_init: Duration) -> Self
See set_max_conn_init(), this is the builder version.
sourcepub fn set_metrics(&mut self, metrics: Registry)
pub fn set_metrics(&mut self, metrics: Registry)
Set the prometheus metrics registry to use. The default is the global static default registry.
sourcepub fn with_metrics(self, metrics: Registry) -> Self
pub fn with_metrics(self, metrics: Registry) -> Self
See set_metrics(), this is the builder version.
sourcepub fn set_lair_client(&mut self, lair_client: LairClient)
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.
sourcepub fn with_lair_client(self, lair_client: LairClient) -> Self
pub fn with_lair_client(self, lair_client: LairClient) -> Self
See set_lair_client(), this is the builder version.
sourcepub fn set_lair_tag(&mut self, lair_tag: Arc<str>)
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.
sourcepub fn with_lair_tag(self, lair_tag: Arc<str>) -> Self
pub fn with_lair_tag(self, lair_tag: Arc<str>) -> Self
See set_lair_tag(), this is the builder version.
sourcepub fn set_new_sig_cb<Cb>(&mut self, cb: Cb)where
Cb: Fn(DynConfig, Tx5Url, SigStateSeed) + 'static + Send + Sync,
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.
sourcepub fn with_new_sig_cb<Cb>(self, cb: Cb) -> Selfwhere
Cb: Fn(DynConfig, Tx5Url, SigStateSeed) + 'static + Send + Sync,
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.
sourcepub fn set_new_conn_cb<Cb>(&mut self, cb: Cb)where
Cb: Fn(DynConfig, Arc<Value>, ConnStateSeed) + 'static + Send + Sync,
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.
sourcepub fn with_new_conn_cb<Cb>(self, cb: Cb) -> Selfwhere
Cb: Fn(DynConfig, Arc<Value>, ConnStateSeed) + 'static + Send + Sync,
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.