CastError

Type Alias CastError 

Source
pub type CastError<Src, Dst>
where Dst: ?Sized,
= ConvertError<AlignmentError<Src, Dst>, SizeError<Src, Dst>, Infallible>;
Expand description

The error type of reference conversions.

Reference conversions, like [FromBytes::ref_from_bytes] may emit alignment and size errors.

Aliased Type§

pub enum CastError<Src, Dst>
where Dst: ?Sized,
{ Alignment(AlignmentError<Src, Dst>), Size(SizeError<Src, Dst>), Validity(Infallible), }

Variants§

§

Alignment(AlignmentError<Src, Dst>)

The conversion source was improperly aligned.

§

Size(SizeError<Src, Dst>)

The conversion source was of incorrect size.

§

Validity(Infallible)

The conversion source contained invalid data.