pub struct FfiCapsuleClient { /* private fields */ }Expand description
The unauthenticated entry point over the SDK’s auth + upload endpoints. Turns
credentials into an FfiSession handle; the protocol pin and endpoints are
captured once here and reused by every session this client mints.
Implementations§
Source§impl FfiCapsuleClient
impl FfiCapsuleClient
Sourcepub fn new(
auth_base_url: String,
upload_base_url: String,
protocol_version: String,
cohort_hash: Option<String>,
) -> Result<Arc<Self>, FfiError>
pub fn new( auth_base_url: String, upload_base_url: String, protocol_version: String, cohort_hash: Option<String>, ) -> Result<Arc<Self>, FfiError>
Build a client.
auth_base_urlis the auth endpoint root (e.g.https://api.example.com/auth).upload_base_urlis the upload endpoint root (POSTtarget; chunk/HEAD hang under{upload_base_url}/{id}).protocol_versionis the pinned protocol date (YYYY-MM-DD).cohort_hashis the optional advisory device-cohort digest;Nonesends nothing (the server behaves identically).
Source§impl FfiCapsuleClient
impl FfiCapsuleClient
Sourcepub async fn login(
&self,
email: String,
password: String,
) -> Result<FfiLoginOutcome, FfiError>
pub async fn login( &self, email: String, password: String, ) -> Result<FfiLoginOutcome, FfiError>
Authenticate with email + password, returning an authenticated session handle.
Sourcepub async fn verify_second_factor(
&self,
mfa_token: String,
totp_code: String,
) -> Result<Arc<FfiSession>, FfiError>
pub async fn verify_second_factor( &self, mfa_token: String, totp_code: String, ) -> Result<Arc<FfiSession>, FfiError>
Complete a sign-in with the code an authenticator app is showing.
mfa_token is what FfiLoginOutcome::SecondFactorRequired carried. It is good once
and for five minutes.
Sourcepub async fn register(
&self,
email: String,
password: String,
) -> Result<Arc<FfiSession>, FfiError>
pub async fn register( &self, email: String, password: String, ) -> Result<Arc<FfiSession>, FfiError>
Create an account and return an authenticated session handle (the server issues tokens on registration). An address and a password, and nothing else: the server takes nothing else. A display name is a fact about a person, and the profile surface that would hold one is owed rather than assumed.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for FfiCapsuleClient
impl<UT> LiftRef<UT> for FfiCapsuleClient
type LiftType = Arc<FfiCapsuleClient>
Source§impl<UT> LowerError<UT> for FfiCapsuleClient
impl<UT> LowerError<UT> for FfiCapsuleClient
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for FfiCapsuleClient
impl<UT> LowerReturn<UT> for FfiCapsuleClient
Source§type ReturnType = <Arc<FfiCapsuleClient> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<FfiCapsuleClient> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for FfiCapsuleClient
impl<UT> TypeId<UT> for FfiCapsuleClient
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl !RefUnwindSafe for FfiCapsuleClient
impl !UnwindSafe for FfiCapsuleClient
impl Freeze for FfiCapsuleClient
impl Send for FfiCapsuleClient
impl Sync for FfiCapsuleClient
impl Unpin for FfiCapsuleClient
impl UnsafeUnpin for FfiCapsuleClient
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> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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