Home
last modified time | relevance | path

Searched refs:CastError (Results 1 – 5 of 5) sorted by relevance

/linux/rust/zerocopy/src/
H A Derror.rs729 pub type CastError<Src, Dst: ?Sized> = typedef
732 impl<Src, Dst: ?Sized> CastError<Src, Dst> { implementation
744 pub(crate) fn with_src<NewSrc>(self, new_src: NewSrc) -> CastError<NewSrc, Dst> { in with_src()
746 Self::Alignment(e) => CastError::Alignment(e.with_src(new_src)), in with_src()
747 Self::Size(e) => CastError::Size(e.with_src(new_src)), in with_src()
774 pub fn map_src<NewSrc>(self, f: impl FnOnce(Src) -> NewSrc) -> CastError<NewSrc, Dst> { in map_src()
776 Self::Alignment(e) => CastError::Alignment(e.map_src(f)), in map_src()
777 Self::Size(e) => CastError::Size(e.map_src(f)), in map_src()
799 unsafe impl<Src, NewSrc, Dst> crate::pointer::TryWithError<NewSrc> for crate::CastError<Src, Dst> implementation
804 type Mapped = crate::CastError<NewSrc, Dst>;
[all …]
H A Dref.rs210 pub(crate) fn sized_from(bytes: B) -> Result<Ref<B, T>, CastError<B, T>> { in sized_from()
228 pub(crate) fn sized_from_prefix(bytes: B) -> Result<(Ref<B, T>, B), CastError<B, T>> { in sized_from_prefix()
249 pub(crate) fn sized_from_suffix(bytes: B) -> Result<(B, Ref<B, T>), CastError<B, T>> { in sized_from_suffix()
311 pub fn from_bytes(source: B) -> Result<Ref<B, T>, CastError<B, T>> { in from_bytes()
365 pub fn from_prefix(source: B) -> Result<(Ref<B, T>, B), CastError<B, T>> { in from_prefix()
430 pub fn from_suffix(source: B) -> Result<(B, Ref<B, T>), CastError<B, T>> { in from_suffix()
491 pub fn from_bytes_with_elems(source: B, count: usize) -> Result<Ref<B, T>, CastError<B, T>> { in from_bytes_with_elems()
545 ) -> Result<(Ref<B, T>, B), CastError<B, T>> { in from_prefix_with_elems()
591 ) -> Result<(B, Ref<B, T>), CastError<B, T>> { in from_suffix_with_elems()
H A Dlib.rs4155 fn ref_from_bytes(source: &[u8]) -> Result<&Self, CastError<&[u8], Self>> in ref_from_bytes()
4267 fn ref_from_prefix(source: &[u8]) -> Result<(&Self, &[u8]), CastError<&[u8], Self>> in ref_from_prefix()
4361 fn ref_from_suffix(source: &[u8]) -> Result<(&[u8], &Self), CastError<&[u8], Self>> in ref_from_suffix()
4445 fn mut_from_bytes(source: &mut [u8]) -> Result<&mut Self, CastError<&mut [u8], Self>> in mut_from_bytes()
4538 ) -> Result<(&mut Self, &mut [u8]), CastError<&mut [u8], Self>> in mut_from_prefix()
4619 ) -> Result<(&mut [u8], &mut Self), CastError<&mut [u8], Self>> in mut_from_suffix()
4712 ) -> Result<&Self, CastError<&[u8], Self>> in ref_from_bytes_with_elems()
4811 ) -> Result<(&Self, &[u8]), CastError<&[u8], Self>> in ref_from_prefix_with_elems()
4905 ) -> Result<(&[u8], &Self), CastError<&[u8], Self>> in ref_from_suffix_with_elems()
4986 ) -> Result<&mut Self, CastError<&mut [u8], Self>> in mut_from_bytes_with_elems()
[all …]
/linux/rust/zerocopy/src/pointer/
H A Dinner.rs21 AlignmentError, CastError, KnownLayout, MetadataOf, SizeError, SplitAt,
567 ) -> Result<(PtrInner<'a, U>, PtrInner<'a, [u8]>), CastError<Self, U>> in try_cast_into()
592 return Err(CastError::Alignment(err)); in try_cast_into()
594 Err(MetadataCastError::Size) => return Err(CastError::Size(SizeError::new(self))), in try_cast_into()
H A Dptr.rs24 AlignmentError, CastError, CastType, KnownLayout, SizeError, TryFromBytes, ValidityError,
1105 CastError<Self, U>, in try_cast_into()
1174 ) -> Result<Ptr<'a, U, (I::Aliasing, Aligned, Initialized)>, CastError<Self, U>> in try_cast_into_no_leftover()
1189 Err(CastError::Size(SizeError::<_, U>::new(()))) in try_cast_into_no_leftover()
1563 Err(CastError::Size(e)) => { in test_try_cast_into_no_leftover_restores_original_slice()