pub struct FsPinStore { /* private fields */ }
Expand description
A filesystem-based implementation of PinStore that persists pin records as JSON files. Each peer’s record is stored in a separate file named after the peer’s hex-encoded ID.
Implementations§
Trait Implementations§
Source§impl Clone for FsPinStore
impl Clone for FsPinStore
Source§fn clone(&self) -> FsPinStore
fn clone(&self) -> FsPinStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl PinStore for FsPinStore
impl PinStore for FsPinStore
Source§fn load(&self, peer: &PeerId) -> Result<Option<PinRecord>, TrustError>
fn load(&self, peer: &PeerId) -> Result<Option<PinRecord>, TrustError>
Load the pin record for a given peer, if one exists.
Returns None if the peer has not been pinned yet.
Source§fn save_first(&self, peer: &PeerId, fpr: [u8; 32]) -> Result<(), TrustError>
fn save_first(&self, peer: &PeerId, fpr: [u8; 32]) -> Result<(), TrustError>
Save the first (initial) fingerprint for a peer.
Fails if the peer is already pinned.
Auto Trait Implementations§
impl Freeze for FsPinStore
impl RefUnwindSafe for FsPinStore
impl Send for FsPinStore
impl Sync for FsPinStore
impl Unpin for FsPinStore
impl UnwindSafe for FsPinStore
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