pub trait DecodableValues {
type Target;
// Required methods
fn decode_next_value<Resolver>(
&mut self,
input: &mut &[u8],
type_id: Resolver::TypeId,
types: &Resolver,
) -> Result<(), Error>
where Resolver: TypeResolver;
fn decoded_target(self) -> Self::Target;
}Expand description
Implementors of this trait are capable of decoding multiple values from bytes into an output type such as a tuple or fixed size array.
Required Associated Types§
Required Methods§
Sourcefn decode_next_value<Resolver>(
&mut self,
input: &mut &[u8],
type_id: Resolver::TypeId,
types: &Resolver,
) -> Result<(), Error>where
Resolver: TypeResolver,
fn decode_next_value<Resolver>(
&mut self,
input: &mut &[u8],
type_id: Resolver::TypeId,
types: &Resolver,
) -> Result<(), Error>where
Resolver: TypeResolver,
Decode the next value. This should be called exactly as
many times as IntoDecodableValues::num_decodable_values, after
which DecodableValues::decoded_target() can be called to
return the decoded target value.
§Panics
This method may panic if it is called more times
than IntoDecodableValues::num_decodable_values.
Sourcefn decoded_target(self) -> Self::Target
fn decoded_target(self) -> Self::Target
Return the decoded target.
§Panics
This method may panic if DecodableValues::decode_next_value has
not been called enough times.
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.