pub struct DryocBox<EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Bytes + Zeroize> { /* private fields */ }Expand description
A libsodium public-key authenticated encrypted box.
Refer to crate::dryocbox for sample usage.
Implementations§
Source§impl<EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: NewByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: NewBytes + ResizableBytes + Zeroize> DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: NewByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: NewBytes + ResizableBytes + Zeroize> DryocBox<EphemeralPublicKey, Mac, Data>
Sourcepub fn encrypt<Message: Bytes + ?Sized, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, SenderSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>>(
message: &Message,
nonce: &Nonce,
recipient_public_key: &RecipientPublicKey,
sender_secret_key: &SenderSecretKey,
) -> Result<Self, Error>
pub fn encrypt<Message: Bytes + ?Sized, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, SenderSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>>( message: &Message, nonce: &Nonce, recipient_public_key: &RecipientPublicKey, sender_secret_key: &SenderSecretKey, ) -> Result<Self, Error>
Source§impl<EphemeralPublicKey: NewByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: NewByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: NewBytes + ResizableBytes + Zeroize> DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey: NewByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: NewByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: NewBytes + ResizableBytes + Zeroize> DryocBox<EphemeralPublicKey, Mac, Data>
Sourcepub fn seal<Message: Bytes + ?Sized, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>>(
message: &Message,
recipient_public_key: &RecipientPublicKey,
) -> Result<Self, Error>
pub fn seal<Message: Bytes + ?Sized, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>>( message: &Message, recipient_public_key: &RecipientPublicKey, ) -> Result<Self, Error>
Encrypts a message for recipient_public_key, using an ephemeral secret
key and nonce. Returns a new DryocBox with ciphertext, tag, and
ephemeral public key.
§Errors
Returns an error if the message is too long, recipient_public_key is
an unacceptable low-order key, or the output storage does not resize to
the message length.
§Panics
Panics if the operating system’s random number generator fails while creating the ephemeral keypair.
Source§impl<'a, EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + TryFrom<&'a [u8]> + Zeroize, Mac: ByteArray<CRYPTO_BOX_MACBYTES> + TryFrom<&'a [u8]> + Zeroize, Data: Bytes + From<&'a [u8]> + Zeroize> DryocBox<EphemeralPublicKey, Mac, Data>
impl<'a, EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + TryFrom<&'a [u8]> + Zeroize, Mac: ByteArray<CRYPTO_BOX_MACBYTES> + TryFrom<&'a [u8]> + Zeroize, Data: Bytes + From<&'a [u8]> + Zeroize> DryocBox<EphemeralPublicKey, Mac, Data>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
Initializes a DryocBox from a slice. Expects the first
CRYPTO_BOX_MACBYTES bytes to contain the message authentication tag,
with the remaining bytes containing the encrypted message.
§Errors
Returns an error if bytes is shorter than one authentication tag or
the tag cannot be converted to Mac.
Sourcepub fn from_sealed_bytes(bytes: &'a [u8]) -> Result<Self, Error>
pub fn from_sealed_bytes(bytes: &'a [u8]) -> Result<Self, Error>
Initializes a sealed DryocBox from a slice. Expects the first
CRYPTO_BOX_PUBLICKEYBYTES bytes to contain the ephemeral public key,
the next CRYPTO_BOX_MACBYTES bytes to be the message authentication
tag, with the remaining bytes containing the encrypted message.
§Errors
Returns an error if bytes is shorter than one ephemeral public key
plus one authentication tag, or if either field cannot be converted to
its target type.
Source§impl<EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Bytes + Zeroize> DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Bytes + Zeroize> DryocBox<EphemeralPublicKey, Mac, Data>
Sourcepub fn from_parts(
ephemeral_pk: Option<EphemeralPublicKey>,
tag: Mac,
data: Data,
) -> Self
pub fn from_parts( ephemeral_pk: Option<EphemeralPublicKey>, tag: Mac, data: Data, ) -> Self
Returns a new box from the (optional) ephemeral_pk, tag, and
data, consuming each. The order matches the wire format of
DryocBox::to_bytes.
Sourcepub fn ephemeral_pk(&self) -> Option<&EphemeralPublicKey>
pub fn ephemeral_pk(&self) -> Option<&EphemeralPublicKey>
Returns the ephemeral public key of a sealed box, or None for a
regular box.
Sourcepub fn to_vec(&self) -> Vec<u8> ⓘ
Available on crate feature alloc only.
pub fn to_vec(&self) -> Vec<u8> ⓘ
alloc only.Copies self into a new Vec
Sourcepub fn into_parts(self) -> (Option<EphemeralPublicKey>, Mac, Data)
pub fn into_parts(self) -> (Option<EphemeralPublicKey>, Mac, Data)
Moves the (optional) ephemeral public key, tag, and data out of this instance, returning them as a tuple in wire order.
Sourcepub fn decrypt<Output: ResizableBytes + NewBytes, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, SenderPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, RecipientSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>>(
&self,
nonce: &Nonce,
sender_public_key: &SenderPublicKey,
recipient_secret_key: &RecipientSecretKey,
) -> Result<Output, Error>
pub fn decrypt<Output: ResizableBytes + NewBytes, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, SenderPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, RecipientSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>>( &self, nonce: &Nonce, sender_public_key: &SenderPublicKey, recipient_secret_key: &RecipientSecretKey, ) -> Result<Output, Error>
Decrypts this box using nonce, recipient_secret_key, and
sender_public_key, returning the decrypted message upon success.
§Errors
Returns an error if the ciphertext is too long, sender_public_key is
an unacceptable low-order key, the output storage has the wrong length,
or authentication fails. Authentication fails for a wrong key, nonce,
tag, or ciphertext.
Sourcepub fn precalc_decrypt<Output: ResizableBytes + NewBytes, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, PrecalcSecretKey: ByteArray<CRYPTO_BOX_BEFORENMBYTES> + Zeroize>(
&self,
nonce: &Nonce,
precalc_secret_key: &PrecalcSecretKey,
) -> Result<Output, Error>
pub fn precalc_decrypt<Output: ResizableBytes + NewBytes, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, PrecalcSecretKey: ByteArray<CRYPTO_BOX_BEFORENMBYTES> + Zeroize>( &self, nonce: &Nonce, precalc_secret_key: &PrecalcSecretKey, ) -> Result<Output, Error>
Decrypts this box using nonce and precalc_secret_key, returning the
decrypted message upon success.
§Errors
Returns an error if the ciphertext is too long, the output storage has the wrong length, or authentication fails because the precomputed key, nonce, tag, or ciphertext does not match.
Sourcepub fn open<Output: ResizableBytes + NewBytes + Zeroize, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, RecipientSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES> + Zeroize>(
&self,
recipient_keypair: &KeyPair<RecipientPublicKey, RecipientSecretKey>,
) -> Result<Output, Error>
pub fn open<Output: ResizableBytes + NewBytes + Zeroize, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, RecipientSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES> + Zeroize>( &self, recipient_keypair: &KeyPair<RecipientPublicKey, RecipientSecretKey>, ) -> Result<Output, Error>
Decrypts this sealed box using recipient_keypair.
§Errors
Returns an error if the ciphertext is too long, the box has no ephemeral public key, that key is an unacceptable low-order key, the output storage has the wrong length, or authentication fails. Authentication fails for the wrong recipient key pair or modified box data.
Sourcepub fn to_bytes<Bytes: NewBytes + ResizableBytes>(&self) -> Bytes
pub fn to_bytes<Bytes: NewBytes + ResizableBytes>(&self) -> Bytes
Copies self into the target. Can be used with protected memory.
Source§impl DryocBox<PublicKey, Mac, Vec<u8>>
impl DryocBox<PublicKey, Mac, Vec<u8>>
Sourcepub fn encrypt_to_vecbox<Message: Bytes + ?Sized, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, SenderSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>>(
message: &Message,
nonce: &Nonce,
recipient_public_key: &RecipientPublicKey,
sender_secret_key: &SenderSecretKey,
) -> Result<Self, Error>
Available on crate feature alloc only.
pub fn encrypt_to_vecbox<Message: Bytes + ?Sized, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, SenderSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>>( message: &Message, nonce: &Nonce, recipient_public_key: &RecipientPublicKey, sender_secret_key: &SenderSecretKey, ) -> Result<Self, Error>
alloc only.Sourcepub fn precalc_encrypt_to_vecbox<Message: Bytes + ?Sized, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, PrecalcSecretKey: ByteArray<CRYPTO_BOX_BEFORENMBYTES> + Zeroize>(
message: &Message,
nonce: &Nonce,
precalc_secret_key: &PrecalcSecretKey,
) -> Result<Self, Error>
Available on crate feature alloc only.
pub fn precalc_encrypt_to_vecbox<Message: Bytes + ?Sized, Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, PrecalcSecretKey: ByteArray<CRYPTO_BOX_BEFORENMBYTES> + Zeroize>( message: &Message, nonce: &Nonce, precalc_secret_key: &PrecalcSecretKey, ) -> Result<Self, Error>
alloc only.Sourcepub fn seal_to_vecbox<Message: Bytes + ?Sized, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>>(
message: &Message,
recipient_public_key: &RecipientPublicKey,
) -> Result<Self, Error>
Available on crate feature alloc only.
pub fn seal_to_vecbox<Message: Bytes + ?Sized, RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>>( message: &Message, recipient_public_key: &RecipientPublicKey, ) -> Result<Self, Error>
alloc only.Encrypts a message for recipient_public_key, using an ephemeral secret
key and nonce, and returns a new DryocBox with the ciphertext,
ephemeral public key, and tag.
§Errors
Returns an error if the message is too long or recipient_public_key is
an unacceptable low-order key.
§Panics
Panics if the operating system’s random number generator fails while creating the ephemeral keypair.
Sourcepub fn decrypt_to_vec<Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, SenderPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, RecipientSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>>(
&self,
nonce: &Nonce,
sender_public_key: &SenderPublicKey,
recipient_secret_key: &RecipientSecretKey,
) -> Result<Vec<u8>, Error>
Available on crate feature alloc only.
pub fn decrypt_to_vec<Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, SenderPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, RecipientSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>>( &self, nonce: &Nonce, sender_public_key: &SenderPublicKey, recipient_secret_key: &RecipientSecretKey, ) -> Result<Vec<u8>, Error>
alloc only.Decrypts this box using nonce, recipient_secret_key and
sender_public_key, returning the decrypted message upon success.
§Errors
Returns an error if the ciphertext is too long, sender_public_key is
an unacceptable low-order key, or authentication fails because a key,
nonce, tag, or ciphertext is wrong.
Sourcepub fn precalc_decrypt_to_vec<Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, PrecalcSecretKey: ByteArray<CRYPTO_BOX_BEFORENMBYTES> + Zeroize>(
&self,
nonce: &Nonce,
precalc_secret_key: &PrecalcSecretKey,
) -> Result<Vec<u8>, Error>
Available on crate feature alloc only.
pub fn precalc_decrypt_to_vec<Nonce: ByteArray<CRYPTO_BOX_NONCEBYTES>, PrecalcSecretKey: ByteArray<CRYPTO_BOX_BEFORENMBYTES> + Zeroize>( &self, nonce: &Nonce, precalc_secret_key: &PrecalcSecretKey, ) -> Result<Vec<u8>, Error>
alloc only.Decrypts this box using nonce and
precalc_secret_key, returning the decrypted message upon
success.
§Errors
Returns an error if the ciphertext is too long or authentication fails because the precomputed key, nonce, tag, or ciphertext does not match.
Sourcepub fn open_to_vec<RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, RecipientSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES> + Zeroize>(
&self,
recipient_keypair: &KeyPair<RecipientPublicKey, RecipientSecretKey>,
) -> Result<Vec<u8>, Error>
Available on crate feature alloc only.
pub fn open_to_vec<RecipientPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, RecipientSecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES> + Zeroize>( &self, recipient_keypair: &KeyPair<RecipientPublicKey, RecipientSecretKey>, ) -> Result<Vec<u8>, Error>
alloc only.Decrypts this sealed box using recipient_keypair.
§Errors
Returns an error if the ciphertext is too long, the box has no ephemeral public key, that key is an unacceptable low-order key, or authentication fails because the recipient key pair or box data is wrong.
Trait Implementations§
Source§impl<EphemeralPublicKey: Clone + ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: Clone + ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Clone + Bytes + Zeroize> Clone for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey: Clone + ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: Clone + ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Clone + Bytes + Zeroize> Clone for DryocBox<EphemeralPublicKey, Mac, Data>
Source§impl<EphemeralPublicKey: Debug + ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: Debug + ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Debug + Bytes + Zeroize> Debug for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey: Debug + ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: Debug + ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Debug + Bytes + Zeroize> Debug for DryocBox<EphemeralPublicKey, Mac, Data>
Source§impl<'de, EphemeralPublicKey, Mac, Data> Deserialize<'de> for DryocBox<EphemeralPublicKey, Mac, Data>where
EphemeralPublicKey: Deserialize<'de> + ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize,
Mac: Deserialize<'de> + ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize,
Data: Deserialize<'de> + Bytes + Zeroize,
Available on crate feature serde only.
impl<'de, EphemeralPublicKey, Mac, Data> Deserialize<'de> for DryocBox<EphemeralPublicKey, Mac, Data>where
EphemeralPublicKey: Deserialize<'de> + ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize,
Mac: Deserialize<'de> + ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize,
Data: Deserialize<'de> + Bytes + Zeroize,
serde only.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>,
Source§impl<EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Bytes + Zeroize> PartialEq for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES> + Zeroize, Mac: ByteArray<CRYPTO_BOX_MACBYTES> + Zeroize, Data: Bytes + Zeroize> PartialEq for DryocBox<EphemeralPublicKey, Mac, Data>
Source§impl<EphemeralPublicKey, Mac, Data> Serialize for DryocBox<EphemeralPublicKey, Mac, Data>
Available on crate feature serde only.
impl<EphemeralPublicKey, Mac, Data> Serialize for DryocBox<EphemeralPublicKey, Mac, Data>
serde only.Auto Trait Implementations§
impl<EphemeralPublicKey, Mac, Data> Freeze for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey, Mac, Data> RefUnwindSafe for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey, Mac, Data> Send for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey, Mac, Data> Sync for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey, Mac, Data> Unpin for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey, Mac, Data> UnsafeUnpin for DryocBox<EphemeralPublicKey, Mac, Data>
impl<EphemeralPublicKey, Mac, Data> UnwindSafe for DryocBox<EphemeralPublicKey, Mac, Data>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
Source§impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Reader into dst.Source§impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Reader into dst.impl<T, C> SchemaReadOwned<C> for Twhere
C: ConfigCore,
T: for<'de> SchemaRead<'de, C>,
Source§impl<T> Serialize for T
impl<T> Serialize for T
Source§fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
alloc only.Vec of bytes.Source§fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
Source§fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
Source§impl<T, C> Serialize<C> for T
impl<T, C> Serialize<C> for T
Source§fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
alloc only.Vec of bytes.