pub trait SpecificEndianOwnedwhere
Self: Clone,{
type Big;
type Little;
// Required methods
fn to_big_endian(&self) -> Self::Big;
fn to_little_endian(&self) -> Self::Little;
fn from_big_endian(&self) -> Self::Big;
fn from_little_endian(&self) -> Self::Little;
// Provided method
fn endian(&self) -> Endian { ... }
}Expand description
Endian conversion trait for owned / non-Copy types.
The existing SpecificEndian trait requires Copy because many of this crate’s
wrapper APIs (like BigEndian<T>::to_bits() and to_native()) return values by copy.
Text and buffer types (e.g. Vec<_>, String) are not Copy, but we still want to
provide endian-aware conversions for them. This trait mirrors the API of
SpecificEndian without requiring Copy.
This is intentionally a separate trait to avoid a breaking change to the existing
SpecificEndian ecosystem.
Required Associated Types§
Required Methods§
fn to_big_endian(&self) -> Self::Big
fn to_little_endian(&self) -> Self::Little
fn from_big_endian(&self) -> Self::Big
fn from_little_endian(&self) -> Self::Little
Provided Methods§
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.
Implementors§
Source§impl SpecificEndianOwned for Utf16StringBE
Available on crate feature text_utf16 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.
impl SpecificEndianOwned for Utf16StringBE
Available on crate feature
text_utf16 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.type Big = Utf16StringBE
type Little = Utf16StringLE
Source§impl SpecificEndianOwned for Utf16StringLE
Available on crate feature text_utf16 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.
impl SpecificEndianOwned for Utf16StringLE
Available on crate feature
text_utf16 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.type Big = Utf16StringBE
type Little = Utf16StringLE
Source§impl SpecificEndianOwned for Utf32StringBE
Available on crate feature text_utf32 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.
impl SpecificEndianOwned for Utf32StringBE
Available on crate feature
text_utf32 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.type Big = Utf32StringBE
type Little = Utf32StringLE
Source§impl SpecificEndianOwned for Utf32StringLE
Available on crate feature text_utf32 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.
impl SpecificEndianOwned for Utf32StringLE
Available on crate feature
text_utf32 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.type Big = Utf32StringBE
type Little = Utf32StringLE
Source§impl<const N: usize> SpecificEndianOwned for FixedUtf16BeCodeUnits<N>
Available on crate feature text_fixed and crate feature text_utf16 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.
impl<const N: usize> SpecificEndianOwned for FixedUtf16BeCodeUnits<N>
Available on crate feature
text_fixed and crate feature text_utf16 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.type Big = FixedUtf16CodeUnitsEndian<BigEndian<u16>, N>
type Little = FixedUtf16CodeUnitsEndian<LittleEndian<u16>, N>
Source§impl<const N: usize> SpecificEndianOwned for FixedUtf16LeCodeUnits<N>
Available on crate feature text_fixed and crate feature text_utf16 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.
impl<const N: usize> SpecificEndianOwned for FixedUtf16LeCodeUnits<N>
Available on crate feature
text_fixed and crate feature text_utf16 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.type Big = FixedUtf16CodeUnitsEndian<BigEndian<u16>, N>
type Little = FixedUtf16CodeUnitsEndian<LittleEndian<u16>, N>
Source§impl<const N: usize> SpecificEndianOwned for FixedUtf32BeCodeUnits<N>
Available on crate feature text_fixed and crate feature text_utf32 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.
impl<const N: usize> SpecificEndianOwned for FixedUtf32BeCodeUnits<N>
Available on crate feature
text_fixed and crate feature text_utf32 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.type Big = FixedUtf32CodeUnitsEndian<BigEndian<u32>, N>
type Little = FixedUtf32CodeUnitsEndian<LittleEndian<u32>, N>
Source§impl<const N: usize> SpecificEndianOwned for FixedUtf32LeCodeUnits<N>
Available on crate feature text_fixed and crate feature text_utf32 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.
impl<const N: usize> SpecificEndianOwned for FixedUtf32LeCodeUnits<N>
Available on crate feature
text_fixed and crate feature text_utf32 and (crate features text_utf8 or text_utf16 or text_utf32 or text_fixed) only.