pub trait NestedDecode: Sized {
// Provided methods
fn dep_decode<I: NestedDecodeInput>(
input: &mut I,
) -> Result<Self, DecodeError> { ... }
fn dep_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<Self, H::HandledErr>
where I: NestedDecodeInput,
H: DecodeErrorHandler { ... }
}
Expand description
Trait that allows zero-copy read of value-references from slices in LE format.
Provided Methods§
Sourcefn dep_decode<I: NestedDecodeInput>(input: &mut I) -> Result<Self, DecodeError>
fn dep_decode<I: NestedDecodeInput>(input: &mut I) -> Result<Self, DecodeError>
Attempt to deserialise the value from input, using the format of an object nested inside another structure. In case of success returns the deserialized value and the number of bytes consumed during the operation.
Sourcefn dep_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<Self, H::HandledErr>where
I: NestedDecodeInput,
H: DecodeErrorHandler,
fn dep_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<Self, H::HandledErr>where
I: NestedDecodeInput,
H: DecodeErrorHandler,
Version of dep_decode
that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.
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.