Struct SecretVLByteVec
pub struct SecretVLByteVec(/* private fields */);Available on 32-bit or 64-bit only.
Expand description
A wrapper struct around VLByteVec that implements [ZeroizeOnDrop].
It behaves just like VLByteVec, except that it doesn’t allow
conversion into a Vec<u8>.
Like VLByteVec, SecretVLByteVec produces a different serde format
than the deprecated SecretVLBytes, but its Deserialize impl is
backwards-compatible: it accepts both its own native encoding and the
legacy SecretVLBytes encoding (a struct with a vec field
containing a sequence of u8) for self-describing serde formats.
Implementations§
§impl SecretVLByteVec
impl SecretVLByteVec
pub fn new(vec: Vec<u8>) -> SecretVLByteVec
pub fn new(vec: Vec<u8>) -> SecretVLByteVec
Generate a new variable-length byte vector that implements
[ZeroizeOnDrop].
Trait Implementations§
§impl AsRef<[u8]> for SecretVLByteVec
impl AsRef<[u8]> for SecretVLByteVec
§impl Clone for SecretVLByteVec
impl Clone for SecretVLByteVec
§fn clone(&self) -> SecretVLByteVec
fn clone(&self) -> SecretVLByteVec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for SecretVLByteVec
impl Debug for SecretVLByteVec
§impl Deserialize for SecretVLByteVec
impl Deserialize for SecretVLByteVec
§fn tls_deserialize<R>(bytes: &mut R) -> Result<SecretVLByteVec, Error>
fn tls_deserialize<R>(bytes: &mut R) -> Result<SecretVLByteVec, Error>
Available on crate feature
std only.This function deserializes the
bytes from the provided a std::io::Read
and returns the populated struct. Read more§impl<'de> Deserialize<'de> for SecretVLByteVec
impl<'de> Deserialize<'de> for SecretVLByteVec
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SecretVLByteVec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SecretVLByteVec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl DeserializeBytes for SecretVLByteVec
impl DeserializeBytes for SecretVLByteVec
§fn tls_deserialize_bytes(
bytes: &[u8],
) -> Result<(SecretVLByteVec, &[u8]), Error>where
SecretVLByteVec: Sized,
fn tls_deserialize_bytes(
bytes: &[u8],
) -> Result<(SecretVLByteVec, &[u8]), Error>where
SecretVLByteVec: Sized,
This function deserializes the
bytes from the provided a &[u8]
and returns the populated struct, as well as the remaining slice. Read more§impl Drop for SecretVLByteVec
impl Drop for SecretVLByteVec
impl Eq for SecretVLByteVec
§impl<const N: usize> From<&[u8; N]> for SecretVLByteVec
impl<const N: usize> From<&[u8; N]> for SecretVLByteVec
§fn from(slice: &[u8; N]) -> SecretVLByteVec
fn from(slice: &[u8; N]) -> SecretVLByteVec
Converts to this type from the input type.
§impl From<&[u8]> for SecretVLByteVec
impl From<&[u8]> for SecretVLByteVec
§fn from(slice: &[u8]) -> SecretVLByteVec
fn from(slice: &[u8]) -> SecretVLByteVec
Converts to this type from the input type.
§impl From<Vec<u8>> for SecretVLByteVec
impl From<Vec<u8>> for SecretVLByteVec
§fn from(vec: Vec<u8>) -> SecretVLByteVec
fn from(vec: Vec<u8>) -> SecretVLByteVec
Converts to this type from the input type.
§impl Hash for SecretVLByteVec
impl Hash for SecretVLByteVec
§impl Ord for SecretVLByteVec
impl Ord for SecretVLByteVec
§fn cmp(&self, other: &SecretVLByteVec) -> Ordering
fn cmp(&self, other: &SecretVLByteVec) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
§impl PartialEq for SecretVLByteVec
impl PartialEq for SecretVLByteVec
§impl PartialOrd for SecretVLByteVec
impl PartialOrd for SecretVLByteVec
§impl Serialize for SecretVLByteVec
impl Serialize for SecretVLByteVec
§impl Serialize for SecretVLByteVec
impl Serialize for SecretVLByteVec
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl Size for SecretVLByteVec
impl Size for SecretVLByteVec
fn tls_serialized_len(&self) -> usize
impl StructuralPartialEq for SecretVLByteVec
§impl Zeroize for SecretVLByteVec
impl Zeroize for SecretVLByteVec
impl ZeroizeOnDrop for SecretVLByteVec
Auto Trait Implementations§
impl Freeze for SecretVLByteVec
impl RefUnwindSafe for SecretVLByteVec
impl Send for SecretVLByteVec
impl Sync for SecretVLByteVec
impl Unpin for SecretVLByteVec
impl UnsafeUnpin for SecretVLByteVec
impl UnwindSafe for SecretVLByteVec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)