Struct DeviceRegistry
pub struct DeviceRegistry { /* private fields */ }Expand description
Registry of paired devices backed by SQLite.
Implementations§
Source§impl DeviceRegistry
impl DeviceRegistry
pub fn new(workspace_dir: &Path) -> Self
pub fn register( &self, token_hash: String, info: DeviceInfo, ) -> Result<(), Error>
pub fn reconcile_from_token_hashes( &self, token_hashes: &[String], ) -> Result<usize, Error>
pub fn list(&self) -> Result<Vec<DeviceInfo>, Error>
pub fn revoke(&self, device_id: &str) -> Result<Option<String>, Error>
Sourcepub fn clear(&self) -> Result<usize, Error>
pub fn clear(&self) -> Result<usize, Error>
Delete every device row and clear the in-memory cache. Returns the
number of rows removed. Pairs with PairingGuard::revoke_all_tokens
for the “rotate after compromise — nuke everything” path so the device
registry does not silently coexist with the now-revoked token set.
pub fn update_last_seen(&self, token_hash: &str)
pub fn update_capabilities( &self, token_hash: &str, capabilities: Vec<String>, ) -> bool
pub fn device_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DeviceRegistry
impl !RefUnwindSafe for DeviceRegistry
impl Send for DeviceRegistry
impl Sync for DeviceRegistry
impl Unpin for DeviceRegistry
impl UnsafeUnpin for DeviceRegistry
impl UnwindSafe for DeviceRegistry
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
§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>
Converts
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>
Converts
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