Trait TryParse
pub trait TryParse: Sized {
// Required method
fn try_parse(value: &[u8]) -> Result<(Self, &[u8]), ParseError>;
}
Expand description
A type implementing this trait can be parsed from some raw bytes.
Required Methods§
fn try_parse(value: &[u8]) -> Result<(Self, &[u8]), ParseError>
fn try_parse(value: &[u8]) -> Result<(Self, &[u8]), ParseError>
Try to parse the given values into an instance of this type.
If parsing is successful, an instance of the type and a slice for the remaining data should be returned. Otherwise, an error is returned.
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.