pub struct Client { /* private fields */ }Expand description
One bounded exchange at a time; callers explicitly retry the same protected intent.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn remove_device(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
target: [u8; 32],
) -> Result<RemovalStatus>
pub async fn remove_device( &self, store: &ProtectedLocalKeyStore, db: &Database, target: [u8; 32], ) -> Result<RemovalStatus>
Remove one active device and attempt a bounded rotation for the survivors. Self-removal can confirm only its in-flight acknowledgement; retired credentials cannot resolve a lost reply. Local data and keys are retained.
pub async fn finish_pending_management( &self, store: &ProtectedLocalKeyStore, db: &Database, ) -> Result<()>
Sourcepub async fn finish_pending_removal(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
) -> Result<()>
pub async fn finish_pending_removal( &self, store: &ProtectedLocalKeyStore, db: &Database, ) -> Result<()>
Continues a retained removal or rotation.
Sourcepub async fn withdraw_expired_disclosure(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
) -> Result<()>
pub async fn withdraw_expired_disclosure( &self, store: &ProtectedLocalKeyStore, db: &Database, ) -> Result<()>
Ends an expired invitation whose grant may have been sent. Admission
and withdrawal are decided only from verified membership: an admitted
candidate finishes ready; otherwise the local fence and server
cancellation precede a targetless freeze and rotation, and withdrawn
needs the chain proof. Expiry never proves withdrawal by itself.
pub async fn cancel( &self, store: &ProtectedLocalKeyStore, db: &Database, inputs: &mut ActiveInputs, handle: [u8; 32], ) -> Result<CancelStatus>
pub async fn manage( &self, store: &ProtectedLocalKeyStore, db: &Database, target: Option<[u8; 32]>, withdraw: Option<[u8; 32]>, ) -> Result<RemovalStatus>
Source§impl Client
impl Client
pub fn new(origin: &str, link: Link) -> Result<Self>
pub async fn exchange( &self, op: Operation, secret: Option<&Secret>, ) -> Result<Reply>
Sourcepub async fn install(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
) -> Result<SharedStateInstallReport>
pub async fn install( &self, store: &ProtectedLocalKeyStore, db: &Database, ) -> Result<SharedStateInstallReport>
Installs only a protected, independently enrolled peer into a fresh target. A completed retry is local and never rewinds later changes.
Sourcepub async fn install_reporting(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
downloaded: &(dyn Fn(u64, Option<u64>) + Sync),
) -> Result<SharedStateInstallReport>
pub async fn install_reporting( &self, store: &ProtectedLocalKeyStore, db: &Database, downloaded: &(dyn Fn(u64, Option<u64>) + Sync), ) -> Result<SharedStateInstallReport>
Self::install, reporting downloaded snapshot bytes. The total is
None until the catalogs that size the rest have arrived.
pub async fn refresh_inputs( &self, store: &ProtectedLocalKeyStore, db: &Database, inputs: &mut ActiveInputs, ) -> Result<()>
pub async fn refresh( &self, store: &ProtectedLocalKeyStore, db: &Database, ) -> Result<()>
pub async fn invite_with_status( &self, store: &ProtectedLocalKeyStore, db: &Database, expires: u64, ) -> Result<CreatedInvitation>
Sourcepub async fn prepare(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
invitation: Option<Invitation>,
replace: bool,
) -> Result<Joiner>
pub async fn prepare( &self, store: &ProtectedLocalKeyStore, db: &Database, invitation: Option<Invitation>, replace: bool, ) -> Result<Joiner>
Selects or creates the attempt to post from protected local state. Its failures are integrity or eligibility refusals, never outcomes of an exchange.
Sourcepub async fn has_other_attempts(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
) -> Result<bool>
pub async fn has_other_attempts( &self, store: &ProtectedLocalKeyStore, db: &Database, ) -> Result<bool>
Whether attempts other than the one prepare returned could still
complete this join.
pub async fn post(&self, peer: &Joiner) -> Result<()>
Sourcepub async fn join_requested(
&self,
vault: [u8; 32],
handle: [u8; 32],
) -> Result<bool>
pub async fn join_requested( &self, vault: [u8; 32], handle: [u8; 32], ) -> Result<bool>
Whether a device has asked to join with this invitation. Only the server is consulted, so frequent checks stay cheap.
Sourcepub async fn admit_handle(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
handle: Option<[u8; 32]>,
) -> Result<bool>
pub async fn admit_handle( &self, store: &ProtectedLocalKeyStore, db: &Database, handle: Option<[u8; 32]>, ) -> Result<bool>
Exact historical outcomes remain addressable after subsequent invitations.
Sourcepub async fn complete(
&self,
store: &ProtectedLocalKeyStore,
db: &Database,
) -> Result<bool>
pub async fn complete( &self, store: &ProtectedLocalKeyStore, db: &Database, ) -> Result<bool>
Checks every retained attempt for an admission and completes the one
whose grant opens for its exact request; a grant that does not open is
an integrity failure. A refusal or unreachable mailbox for one attempt
proves nothing about the others: any busy mailbox is reported as busy,
any attempt still waiting yields false, and only when every mailbox
failed is the latest attempt’s error reported. Once a response is
pinned, only that attempt is checked.
pub async fn finish( &self, store: &ProtectedLocalKeyStore, db: &Database, peer: &Joiner, mail: &Mailbox, grant: ProvisionalGrant, ) -> Result<()>
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.