pub struct UpgradeClient { /* private fields */ }Expand description
The album-upgrade proposal client. Borrows an authenticated Session, so every call
rides the SDK’s bearer/refresh machinery and no token is handled here.
Implementations§
Source§impl UpgradeClient
impl UpgradeClient
Sourcepub fn new(session: Session, api_base_url: &str) -> Self
pub fn new(session: Session, api_base_url: &str) -> Self
Build a client against the API root — the origin the operation paths hang off (e.g.
https://api.example.com), the same base crate::client::AuthenticatedClient,
crate::sync::SyncConsumer and crate::recovery::RecoveryClient take.
Note that crate::directory and crate::verify take a deeper base instead. That
divergence is real and is noticed in capsule-server/tests/sdk_client.rs; it is not
this module’s to close, and a new module choosing the root is how it narrows.
Sourcepub async fn begin(
&self,
album_id: Uuid,
intent_cbor: &[u8],
) -> Result<UpgradePhase, UpgradeError>
pub async fn begin( &self, album_id: Uuid, intent_cbor: &[u8], ) -> Result<UpgradePhase, UpgradeError>
Propose the upgrade intent_cbor describes for album_id, returning the ceremony the
server now holds.
intent_cbor is the canonical CBOR of a signed UpgradeIntent and is sent verbatim
— this method never re-encodes it, because the signature is over exactly those bytes.
§Errors
UpgradeError::InFlight when another ceremony already holds the album (only one may),
UpgradeError::NotProposer when the signing device is not in the published directory,
and the rest of UpgradeError for the remaining refusals.
Trait Implementations§
Source§impl Clone for UpgradeClient
impl Clone for UpgradeClient
Source§fn clone(&self) -> UpgradeClient
fn clone(&self) -> UpgradeClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for UpgradeClient
impl !UnwindSafe for UpgradeClient
impl Freeze for UpgradeClient
impl Send for UpgradeClient
impl Sync for UpgradeClient
impl Unpin for UpgradeClient
impl UnsafeUnpin for UpgradeClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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