pub struct KeyCache { /* private fields */ }Expand description
Key documents this mesh has fetched or been given, by host: each the result of interpreting a retrieval (SPEC 9.3), a failure included.
Implementations§
Source§impl KeyCache
impl KeyCache
Sourcepub fn insert(&self, host: &str, doc: &[u8]) -> Result<(), CoreError>
pub fn insert(&self, host: &str, doc: &[u8]) -> Result<(), CoreError>
Adds (or replaces) host’s key document, checked as a 200 response for that host;
a document that fails the check is not added.
Sourcepub fn insert_response(&self, host: &str, status: u16, body: Option<&[u8]>)
pub fn insert_response(&self, host: &str, status: u16, body: Option<&[u8]>)
Records what retrieving host’s key document gave (status and body, as SPEC 9.3
interprets them): a document, or the failure (E_KEY_UNAVAILABLE, E_KEY_DOC).
Sourcepub fn get(&self, host: &str) -> Option<(KeyDoc, Vec<u8>, Instant)>
pub fn get(&self, host: &str) -> Option<(KeyDoc, Vec<u8>, Instant)>
host’s document, its bytes and when it was fetched.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for KeyCache
impl RefUnwindSafe for KeyCache
impl Send for KeyCache
impl Sync for KeyCache
impl Unpin for KeyCache
impl UnsafeUnpin for KeyCache
impl UnwindSafe for KeyCache
Blanket Implementations§
impl<T> Allocation for T
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