pub trait ItemObjectParseable: Sized {
// Required methods
fn check_label(label: &str) -> Result<(), ErrorProblem>;
fn from_bytes(input: &[u8]) -> Result<Self, ErrorProblem>;
// Provided method
fn from_bytes_option(input: Option<&[u8]>) -> Result<Self, ErrorProblem> { ... }
}
Available on crate feature
parse2
only.Expand description
A possibly-optional Object value that can appear in netdoc
Implemented for Option
, so that field: Option<ObjectValue>
allows parsing an optional object.
Required Methods§
Sourcefn check_label(label: &str) -> Result<(), ErrorProblem>
fn check_label(label: &str) -> Result<(), ErrorProblem>
Check that the Label is right
Sourcefn from_bytes(input: &[u8]) -> Result<Self, ErrorProblem>
fn from_bytes(input: &[u8]) -> Result<Self, ErrorProblem>
Convert the bytes of the Object (which was present) into the actual value
input
has been base64-decoded.
Provided Methods§
Sourcefn from_bytes_option(input: Option<&[u8]>) -> Result<Self, ErrorProblem>
fn from_bytes_option(input: Option<&[u8]>) -> Result<Self, ErrorProblem>
Convert the bytes of the Object, if any, into the actual value
If there was an Object, input
has been base64-decoded.
If there was no Object, input
is None
.
The provided implementation considers a missing object to be an error.
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.