pub struct EncryptedOurPeerStorage { /* private fields */ }Expand description
EncryptedOurPeerStorage represents encrypted state of the corresponding DecryptedOurPeerStorage.
§Key Methods
EncryptedOurPeerStorage::new: ReturnsEncryptedOurPeerStoragewith the given encrypted cipher.EncryptedOurPeerStorage::decrypt: ReturnsDecryptedOurPeerStoragecreated from decrypting the cipher.EncryptedOurPeerStorage::into_vec: Returns the cipher inVec<u8>format.
Implementations§
Source§impl EncryptedOurPeerStorage
impl EncryptedOurPeerStorage
Sourcepub fn new(cipher: Vec<u8>) -> Result<Self, ()>
pub fn new(cipher: Vec<u8>) -> Result<Self, ()>
Returns EncryptedOurPeerStorage if cipher is of appropriate length, else returns error.
Sourcepub fn decrypt(
self,
key: &PeerStorageKey,
) -> Result<DecryptedOurPeerStorage, ()>
pub fn decrypt( self, key: &PeerStorageKey, ) -> Result<DecryptedOurPeerStorage, ()>
Returns DecryptedOurPeerStorage if it successfully decrypts the ciphertext with the key,
else returns error.
Auto Trait Implementations§
impl Freeze for EncryptedOurPeerStorage
impl RefUnwindSafe for EncryptedOurPeerStorage
impl Send for EncryptedOurPeerStorage
impl Sync for EncryptedOurPeerStorage
impl Unpin for EncryptedOurPeerStorage
impl UnwindSafe for EncryptedOurPeerStorage
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