Trait Array

Source
pub trait Array:
    Clone
    + Send
    + Sync
    + 'static
    + Eq
    + PartialEq
    + Ord
    + PartialOrd
    + Debug
    + Hash
    + Display
    + AsRef<[u8]>
    + Deref<Target = [u8]>
    + for<'a> TryFrom<&'a [u8], Error = Error>
    + for<'a> TryFrom<&'a Vec<u8>, Error = Error>
    + TryFrom<Vec<u8>, Error = Error>
    + SizedSerialize {
    // Provided method
    fn read_from<B: Buf>(buf: &mut B) -> Result<Self, Error> { ... }
}
Expand description

Types that can be fallibly read from a fixed-size byte sequence.

Array is typically used to parse things like PublicKeys and Signatures from an untrusted network connection. Once parsed, these types are assumed to be well-formed (which prevents duplicate validation).

If a byte sequencer is not properly formatted, TryFrom must return an error.

Provided Methods§

Source

fn read_from<B: Buf>(buf: &mut B) -> Result<Self, Error>

Attempts to read an array from the provided buffer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Array for commonware_cryptography::bls12381::PrivateKey

Source§

impl Array for commonware_cryptography::bls12381::PublicKey

Source§

impl Array for commonware_cryptography::bls12381::Signature

Source§

impl Array for commonware_cryptography::ed25519::PrivateKey

Source§

impl Array for commonware_cryptography::ed25519::PublicKey

Source§

impl Array for commonware_cryptography::ed25519::Signature

Source§

impl Array for commonware_cryptography::secp256r1::PrivateKey

Source§

impl Array for commonware_cryptography::secp256r1::PublicKey

Source§

impl Array for commonware_cryptography::secp256r1::Signature

Source§

impl Array for Digest