Skip to main content

ClientConfig

Struct ClientConfig 

Source
#[non_exhaustive]
pub struct ClientConfig { pub app_id: String, pub data_dir: PathBuf, pub device_store: StoreChoice, pub device_platform: DevicePlatform, pub reconnect_window: Duration, pub connect_timeout: Duration, pub crypto_provider: Option<Arc<CryptoProvider>>, pub video_h264: bool, }
Expand description

The engine’s configuration (one per app).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§app_id: String

The host’s app identifier (with feature keyring-store, sew-voice.<app id> is the OS credential store’s service).

§data_dir: PathBuf

The host’s data directory (the device store’s public data).

§device_store: StoreChoice

Where crate::CallClient::with_mls keeps the device key and its public record. Default StoreChoice::Auto: a 0600 file, warned as key_storage_file (with feature keyring-store, the OS credential store first). A host passes its own store with ClientConfig::with_device_key_store.

§device_platform: DevicePlatform

The platform the device enrols as. Default from target_os (iOS, Android, otherwise desktop); a host sets it with ClientConfig::with_device_platform.

§reconnect_window: Duration

The reconnect window (Sew’s media server’s reconnect_window_ms, 20 s): resume and full reconnects inside it; after it, a re-join through the provider.

§connect_timeout: Duration

How long the first connect may take before the call ends with network.

§crypto_provider: Option<Arc<CryptoProvider>>

The rustls crypto provider of every TLS connection (signalling, TURN-TLS, the client API and the key routes). None (the default): the process default (CryptoProvider::get_default, e.g. one the host installed with install_default), else the built-in ring provider (feature builtin-ring-provider, on by default; without it, TLS setup fails with no_crypto_provider). A host sets it with ClientConfig::with_crypto_provider.

§video_h264: bool

Whether the media connection negotiates H.264 beside VP8 (feature video-core): the receive sections offer it, so the media server may forward H.264 tracks, and a camera or screen may publish in it. Default default_video_h264: on where this device can show H.264 (VideoToolbox on macOS and iOS; the webview’s WebCodecs elsewhere), off on Linux, which has no H.264 decoder in the engine (kessel-video decodes only VP8 there), so the media server never sends a Linux client H.264 it can’t show. A host that decodes H.264 itself turns it on with ClientConfig::with_video_h264.

It is an upper bound: once the host declares its decoders (crate::CallClient::set_video_decode), H.264 is offered only if they list it (never on Linux), and never under crate::VideoCodecPreference::PreferVp8.

Implementations§

Source§

impl ClientConfig

Source

pub fn new(app_id: &str, data_dir: PathBuf) -> ClientConfig

A config with the defaults.

Source

pub fn with_video_h264(self, on: bool) -> ClientConfig

Negotiates H.264 (true) or VP8 only (false) for video, instead of the default_video_h264 of this platform (ClientConfig::video_h264).

Source

pub fn with_device_key_store( self, store: Arc<dyn DeviceKeyStore>, ) -> ClientConfig

Keeps the device’s private key and public record in the host’s own store (e.g. K2’s keyring or vault) instead of the built-in file (StoreChoice::Host).

Source

pub fn with_hardware_device_key( self, key: Arc<dyn HardwareDeviceKey>, ) -> ClientConfig

Keeps the device’s private key in the host’s hardware (Secure Enclave, StrongBox/TEE) through HardwareDeviceKey (StoreChoice::Hardware); the public record stays in the data directory. It replaces any other store, and the engine never falls back to a software key.

Source

pub fn with_device_platform(self, platform: DevicePlatform) -> ClientConfig

The platform the device enrols as (instead of the target_os default).

Source

pub fn with_crypto_provider(self, provider: Arc<CryptoProvider>) -> ClientConfig

Builds every TLS connection on provider (e.g. the host’s own rustls provider) instead of the process default.

Source§

impl ClientConfig

Source

pub fn tls(&self) -> Result<Arc<TlsConfig>, Error>

The TLS client config the engine uses for every connection (the platform’s trust; in a testing build, plus the run CA), on the provider ClientConfig::crypto_provider describes. Hosts that set up the keys themselves (crate::e2ee::MlsKeys::prepare_session_join) pass it on.

Trait Implementations§

Source§

impl Clone for ClientConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientConfig

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CryptoSafe for T
where T: Send + Sync + Debug,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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.
Source§

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

Source§

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