pub struct Client { /* private fields */ }Expand description
An app’s update verifier: the pinned root, the trusted root chain and anti-rollback state.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(pin: RootPin, initial_root: &Signed, now: Timestamp) -> Result<Self>
pub fn new(pin: RootPin, initial_root: &Signed, now: Timestamp) -> Result<Self>
Starts from the first root, checked against the pin compiled into the app.
Sourcepub fn from_state(
pin: RootPin,
state: ClientState,
now: Timestamp,
) -> Result<Self>
pub fn from_state( pin: RootPin, state: ClientState, now: Timestamp, ) -> Result<Self>
Restores saved state, re-verifying the whole root chain from the pin.
Sourcepub fn state(&self) -> &ClientState
pub fn state(&self) -> &ClientState
State to persist after each change.
Sourcepub fn update_root(&mut self, env: &Signed, now: Timestamp) -> Result<()>
pub fn update_root(&mut self, env: &Signed, now: Timestamp) -> Result<()>
Applies a root rotation. Versions at or below the trusted one are ignored if they are the same document, and refused otherwise.
Sourcepub fn verify(
&mut self,
app: &str,
channel: &str,
bundle: &UpdateBundle,
opts: &VerifyOptions,
) -> Result<VerifiedUpdate>
pub fn verify( &mut self, app: &str, channel: &str, bundle: &UpdateBundle, opts: &VerifyOptions, ) -> Result<VerifiedUpdate>
Runs the acceptance rule for app/channel and records the seq on success.
Sourcepub fn mark_installed(&mut self, update: &VerifiedUpdate)
pub fn mark_installed(&mut self, update: &VerifiedUpdate)
Records that an update was installed and committed (after its boot check).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Client
impl Freeze for Client
impl Move 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
Mutably borrows from an owned value. Read more