Trait SmlParse

Source
pub trait SmlParse<'i, T>: Sized + Sealed {
    type Error;

    // Required method
    fn parse_from(value: T) -> Result<Self, Self::Error>;
}
Expand description

Helper trait implemented for types that can be built from decoded bytes.

Required Associated Types§

Source

type Error

The error produced if parsing fails or the input contained an error.

Required Methods§

Source

fn parse_from(value: T) -> Result<Self, Self::Error>

Takes the result of decoding and parses it into the resulting type.

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<'i> SmlParse<'i, &'i [u8]> for File<'i>

Available on crate feature alloc only.
Source§

impl<'i> SmlParse<'i, &'i [u8]> for Parser<'i>

Source§

impl<'i> SmlParse<'i, &'i [u8]> for DecodedBytes<'i>

Source§

impl<'i, ReadErr> SmlParse<'i, Result<&'i [u8], ReadDecodedError<ReadErr>>> for File<'i>
where ReadErr: Debug,

Available on crate feature alloc only.
Source§

impl<'i, ReadErr> SmlParse<'i, Result<&'i [u8], ReadDecodedError<ReadErr>>> for Parser<'i>
where ReadErr: Debug,

Source§

impl<'i, ReadErr> SmlParse<'i, Result<&'i [u8], ReadDecodedError<ReadErr>>> for DecodedBytes<'i>
where ReadErr: Debug,