Struct warg_protocol::SerdeEnvelope
source · pub struct SerdeEnvelope<Contents> { /* private fields */ }
Implementations§
source§impl<Contents> SerdeEnvelope<Contents>
impl<Contents> SerdeEnvelope<Contents>
sourcepub fn from_parts_unchecked(
contents: Contents,
key_id: KeyID,
signature: Signature
) -> Self
pub fn from_parts_unchecked( contents: Contents, key_id: KeyID, signature: Signature ) -> Self
Creates a new SerdeEnvelope
from the given content, key ID, and signature.
Note that this does not verify the signature matches the contents (hence unchecked).
sourcepub fn signed_contents(
private_key: &PrivateKey,
contents: Contents
) -> Result<Self, SignatureError>where
Contents: Signable,
pub fn signed_contents(
private_key: &PrivateKey,
contents: Contents
) -> Result<Self, SignatureError>where
Contents: Signable,
Create an envelope for some contents using a signature.
pub fn into_contents(self) -> Contents
pub fn key_id(&self) -> &KeyID
pub fn signature(&self) -> &Signature
Trait Implementations§
source§impl<Content> AsRef<Content> for SerdeEnvelope<Content>
impl<Content> AsRef<Content> for SerdeEnvelope<Content>
source§impl<Contents: Clone> Clone for SerdeEnvelope<Contents>
impl<Contents: Clone> Clone for SerdeEnvelope<Contents>
source§fn clone(&self) -> SerdeEnvelope<Contents>
fn clone(&self) -> SerdeEnvelope<Contents>
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<Contents: Debug> Debug for SerdeEnvelope<Contents>
impl<Contents: Debug> Debug for SerdeEnvelope<Contents>
source§impl<'de, Contents> Deserialize<'de> for SerdeEnvelope<Contents>where
Contents: Deserialize<'de>,
impl<'de, Contents> Deserialize<'de> for SerdeEnvelope<Contents>where
Contents: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<Contents: PartialEq> PartialEq for SerdeEnvelope<Contents>
impl<Contents: PartialEq> PartialEq for SerdeEnvelope<Contents>
source§fn eq(&self, other: &SerdeEnvelope<Contents>) -> bool
fn eq(&self, other: &SerdeEnvelope<Contents>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Contents> Serialize for SerdeEnvelope<Contents>where
Contents: Serialize,
impl<Contents> Serialize for SerdeEnvelope<Contents>where
Contents: Serialize,
impl<Contents: Eq> Eq for SerdeEnvelope<Contents>
impl<Contents> StructuralPartialEq for SerdeEnvelope<Contents>
Auto Trait Implementations§
impl<Contents> Freeze for SerdeEnvelope<Contents>where
Contents: Freeze,
impl<Contents> RefUnwindSafe for SerdeEnvelope<Contents>where
Contents: RefUnwindSafe,
impl<Contents> Send for SerdeEnvelope<Contents>where
Contents: Send,
impl<Contents> Sync for SerdeEnvelope<Contents>where
Contents: Sync,
impl<Contents> Unpin for SerdeEnvelope<Contents>where
Contents: Unpin,
impl<Contents> UnwindSafe for SerdeEnvelope<Contents>where
Contents: UnwindSafe,
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.