Trait TryFromBytes

Source
pub trait TryFromBytes: Sized {
    type Error: Debug + Display;

    // Required method
    fn try_from_bytes(
        bytes: &mut impl Iterator<Item = u8>,
    ) -> Option<Result<Self, Self::Error>>;
}
Expand description

Operation types that may be parsed from a bytecode representation.

Required Associated Types§

Source

type Error: Debug + Display

Represents any error that might occur while parsing an op from bytes.

Required Methods§

Source

fn try_from_bytes( bytes: &mut impl Iterator<Item = u8>, ) -> Option<Result<Self, Self::Error>>

Parse a single operation from the given iterator yielding bytes.

Returns None in the case that the given iterator is empty.

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§