Skip to content

Commit

Permalink
Add docs for additional pickle functions
Browse files Browse the repository at this point in the history
  • Loading branch information
devonh committed Sep 3, 2024
1 parent 5b299ee commit 99d073f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pk_encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ impl Default for PkDecryption {
}
}

/// Attempt to decode a [`PkDecryption`] object from a [`PkDecryptionPickle`] object.
impl TryFrom<PkDecryptionPickle> for PkDecryption {
type Error = crate::LibolmPickleError;

Expand All @@ -247,6 +248,7 @@ impl TryFrom<PkDecryptionPickle> for PkDecryption {
}
}

/// A libolm compatible and picklable form of [`PkDecryption`].
#[derive(Encode, Decode, Zeroize, ZeroizeOnDrop)]
struct PkDecryptionPickle {
version: u32,
Expand All @@ -255,6 +257,7 @@ struct PkDecryptionPickle {
}

impl From<&PkDecryption> for PkDecryptionPickle {
/// Create a new [`PkDecryptionPickle`] object from a [`PkDecryption`] object.
fn from(decrypt: &PkDecryption) -> Self {
Self {
version: PICKLE_VERSION,
Expand Down

0 comments on commit 99d073f

Please sign in to comment.