slice_from_prefix returns Option<(&[Self], &[u8])>
slice_from_suffix returns Option<(&[u8], &[Self])>
mut_slice_from_prefix returns Option<(&mut [Self], &mut [u8])>
mut_slice_from_suffix returns Option<(&mut [u8], &mut [Self])>
However, all of the other methods drop the prefix/suffix:
FromBytes::read_from_prefix returns Option<Self>
FromBytes::read_from_suffix returns Option<Self>
FromBytes::ref_from_prefix returns Option<&Self>
FromBytes::ref_from_suffix returns Option<&Self>
FromBytes::mut_from_prefix returns Option<&mut Self>
FromBytes::mut_from_suffix returns Option<&mut Self>
This is desirable: the majority of the time I drop the prefix anyways and these are convenience methods for methods in Ref.
[ref|mut]_from_[prefix|suffix] in their docs both point to using Ref to preserve the prefix/suffix.
slice_from_prefixreturnsOption<(&[Self], &[u8])>slice_from_suffixreturnsOption<(&[u8], &[Self])>mut_slice_from_prefixreturnsOption<(&mut [Self], &mut [u8])>mut_slice_from_suffixreturnsOption<(&mut [u8], &mut [Self])>However, all of the other methods drop the prefix/suffix:
FromBytes::read_from_prefixreturnsOption<Self>FromBytes::read_from_suffixreturnsOption<Self>FromBytes::ref_from_prefixreturnsOption<&Self>FromBytes::ref_from_suffixreturnsOption<&Self>FromBytes::mut_from_prefixreturnsOption<&mut Self>FromBytes::mut_from_suffixreturnsOption<&mut Self>This is desirable: the majority of the time I drop the prefix anyways and these are convenience methods for methods in
Ref.[ref|mut]_from_[prefix|suffix]in their docs both point to usingRefto preserve the prefix/suffix.