pub struct ClientConfig {
pub identity: Identity,
pub device_label: String,
pub storage: Arc<dyn Storage>,
pub transport: Arc<dyn Transport>,
pub now_ms: u64,
pub storage_backend: StorageBackend,
pub device_signing_secret_key: Option<[u8; 32]>,
}Fields§
§identity: Identity§device_label: String§storage: Arc<dyn Storage>§transport: Arc<dyn Transport>§now_ms: u64Wall clock in ms. Pulled from the host so we can use a synthetic clock in tests.
storage_backend: StorageBackend[CR-4] OpenMLS-provider backend. Defaults to in-memory; iOS NSE and web SW
cold-start paths MUST pass StorageBackend::Sqlite { path, encryption_key }
(native) or StorageBackend::IndexedDb { db_name } (WASM, when that lands).
See docs/design/CR4_CR7_PERSISTENCE.md.
device_signing_secret_key: Option<[u8; 32]>Optional 32-byte Ed25519 secret key the SDK should use as the
device signing key. When set AND no LocalDevice is yet
persisted in storage, the SDK constructs its first
LocalDevice from this key instead of generating a fresh
random one — so device_id = SHA-256(public_key_of(secret))
is fully determined by what the host provided.
Use case: align the SDK’s device_id (which it stamps into
every envelope’s sender_device field) with an externally-
computed device id — typically SHA-256(device_signing_pubkey)
in the host’s auth layer, where the JWT carries that same
value as its device_id claim. Without this alignment, a
server that validates envelope.sender_device == jwt.device_id would reject every send.
Ignored on re-init (when storage already has a persisted
LocalDevice) so the device identity remains stable across
restarts.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ClientConfig
impl !UnwindSafe for ClientConfig
impl Freeze 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
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