pub struct Keys { /* private fields */ }Expand description
Bonds and our identity.
Implementations§
Source§impl Keys
impl Keys
Sourcepub fn open(dir: Option<&Path>) -> Result<Keys>
pub fn open(dir: Option<&Path>) -> Result<Keys>
Opens (or creates) the key files in dir; None keeps everything in memory.
Sourcepub fn local_static_address(&self) -> Address
pub fn local_static_address(&self) -> Address
Our static random address (used when the controller has no public one).
Sourcepub fn bond(&self, identity: &Address) -> Option<Bond>
pub fn bond(&self, identity: &Address) -> Option<Bond>
The bond with a device, by identity address.
Sourcepub fn update(
&self,
identity: &Address,
f: impl FnOnce(&mut Bond),
) -> Result<bool>
pub fn update( &self, identity: &Address, f: impl FnOnce(&mut Bond), ) -> Result<bool>
Updates a bond in place, if there is one.
Sourcepub fn remove(&self, identity: &Address) -> Result<bool>
pub fn remove(&self, identity: &Address) -> Result<bool>
Forgets a device. Returns whether there was a bond.
Sourcepub fn add_irk(
&self,
identity: Address,
irk: u128,
label: Option<String>,
) -> Result<()>
pub fn add_irk( &self, identity: Address, irk: u128, label: Option<String>, ) -> Result<()>
Records an IRK known without pairing (some tags print theirs), so the
device’s private addresses resolve to identity.
Sourcepub fn identity_of(&self, addr: &Address) -> Option<Address>
pub fn identity_of(&self, addr: &Address) -> Option<Address>
The identity a device uses this address for: resolved from an IRK for a private address, or a bond’s identity or alias.
Auto Trait Implementations§
impl !Freeze for Keys
impl RefUnwindSafe for Keys
impl Send for Keys
impl Sync for Keys
impl Unpin for Keys
impl UnsafeUnpin for Keys
impl UnwindSafe for Keys
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