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§
Required Methods§
Sourcefn parse_from(value: T) -> Result<Self, Self::Error>
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.
impl<'i> SmlParse<'i, &'i [u8]> for File<'i>
Available on crate feature
alloc
only.type Error = ParseError
Source§impl<'i> SmlParse<'i, &'i [u8]> for DecodedBytes<'i>
impl<'i> SmlParse<'i, &'i [u8]> for DecodedBytes<'i>
type Error = Infallible
Source§impl<'i, ReadErr> SmlParse<'i, Result<&'i [u8], ReadDecodedError<ReadErr>>> for File<'i>where
ReadErr: Debug,
Available on crate feature alloc
only.
impl<'i, ReadErr> SmlParse<'i, Result<&'i [u8], ReadDecodedError<ReadErr>>> for File<'i>where
ReadErr: Debug,
Available on crate feature
alloc
only.