#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.app_id: StringThe host’s app identifier (with feature keyring-store, sew-voice.<app id> is the OS
credential store’s service).
data_dir: PathBufThe host’s data directory (the device store’s public data).
device_store: StoreChoiceWhere 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: DevicePlatformThe platform the device enrols as. Default from target_os (iOS, Android, otherwise
desktop); a host sets it with ClientConfig::with_device_platform.
reconnect_window: DurationThe 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: DurationHow 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: boolWhether 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
impl ClientConfig
Sourcepub fn new(app_id: &str, data_dir: PathBuf) -> ClientConfig
pub fn new(app_id: &str, data_dir: PathBuf) -> ClientConfig
A config with the defaults.
Sourcepub fn with_video_h264(self, on: bool) -> ClientConfig
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).
Sourcepub fn with_device_key_store(
self,
store: Arc<dyn DeviceKeyStore>,
) -> ClientConfig
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).
Sourcepub fn with_hardware_device_key(
self,
key: Arc<dyn HardwareDeviceKey>,
) -> ClientConfig
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.
Sourcepub fn with_device_platform(self, platform: DevicePlatform) -> ClientConfig
pub fn with_device_platform(self, platform: DevicePlatform) -> ClientConfig
The platform the device enrols as (instead of the target_os default).
Sourcepub fn with_crypto_provider(self, provider: Arc<CryptoProvider>) -> ClientConfig
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
impl ClientConfig
Sourcepub fn tls(&self) -> Result<Arc<TlsConfig>, Error>
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
impl Clone for ClientConfig
Auto Trait Implementations§
impl !RefUnwindSafe for ClientConfig
impl !UnwindSafe for ClientConfig
impl Forget for ClientConfig
impl Freeze for ClientConfig
impl Move for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CryptoSafe for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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