Struct hypercore::PartialKeypair
source · pub struct PartialKeypair {
pub public: VerifyingKey,
pub secret: Option<SigningKey>,
}
Expand description
Key pair where for read-only hypercores the secret key can also be missing.
Fields§
§public: VerifyingKey
Public key
secret: Option<SigningKey>
Secret key. If None, the hypercore is read-only.
Trait Implementations§
source§impl Clone for PartialKeypair
impl Clone for PartialKeypair
source§fn clone(&self) -> PartialKeypair
fn clone(&self) -> PartialKeypair
Returns a copy 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 CompactEncoding<PartialKeypair> for State
impl CompactEncoding<PartialKeypair> for State
NB: In Javascript’s sodium the secret key contains in itself also the public key, so to maintain binary compatibility, we store the public key in the oplog now twice.
source§fn preencode(&mut self, value: &PartialKeypair) -> Result<usize, EncodingError>
fn preencode(&mut self, value: &PartialKeypair) -> Result<usize, EncodingError>
Preencode
source§fn encode(
&mut self,
value: &PartialKeypair,
buffer: &mut [u8]
) -> Result<usize, EncodingError>
fn encode( &mut self, value: &PartialKeypair, buffer: &mut [u8] ) -> Result<usize, EncodingError>
Encode
source§fn decode(&mut self, buffer: &[u8]) -> Result<PartialKeypair, EncodingError>
fn decode(&mut self, buffer: &[u8]) -> Result<PartialKeypair, EncodingError>
Decode
Auto Trait Implementations§
impl RefUnwindSafe for PartialKeypair
impl Send for PartialKeypair
impl Sync for PartialKeypair
impl Unpin for PartialKeypair
impl UnwindSafe for PartialKeypair
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