Trait blart::OrderedBytes

source ·
pub unsafe trait OrderedBytes: AsBytes + Ord { }
Expand description

This trait is used to mark types where the lexicographic ordering of their byte representation (as output by AsBytes::as_bytes) matches their normal ordering (as determined by Ord).

Safety

This trait can only be implemented if the above condition holds.

Implementations on Foreign Types§

source§

impl OrderedBytes for PathBuf

source§

impl OrderedBytes for str

source§

impl OrderedBytes for CStr

source§

impl<'a, B> OrderedBytes for Cow<'a, B>where B: OrderedBytes + 'a + ToOwned + ?Sized, Cow<'a, B>: AsBytes,

source§

impl<T> OrderedBytes for Box<T>where T: OrderedBytes + ?Sized,

source§

impl<T> OrderedBytes for Rc<T>where T: OrderedBytes + ?Sized,

source§

impl OrderedBytes for String

source§

impl<const N: usize, T> OrderedBytes for [T; N]where T: OrderedBytes, [T; N]: AsBytes,

SAFETY: The lexicographic ordering of [u8; N] converted to bytes is the same as its normal representation

source§

impl OrderedBytes for u8

SAFETY: Since u8 is a single byte, there are no concerns about endian ordering

source§

impl<T> OrderedBytes for Arc<T>where T: OrderedBytes + ?Sized,

source§

impl<'a, T> OrderedBytes for &'a mut Twhere T: OrderedBytes + ?Sized,

source§

impl<'a, T> OrderedBytes for &'a Twhere T: OrderedBytes + ?Sized,

source§

impl OrderedBytes for Path

source§

impl OrderedBytes for CString

source§

impl OrderedBytes for OsStr

source§

impl<T> OrderedBytes for [T]where T: OrderedBytes, [T]: AsBytes,

SAFETY: The ordering of a slice is the lexicographic ordering of the elements. If each element compares the same if it is converted to bytes, then converting the entire slice to bytes should compare the same as the original slice.

source§

impl OrderedBytes for OsString

source§

impl<T> OrderedBytes for Vec<T>where T: OrderedBytes, Vec<T>: AsBytes,

SAFETY: Same reasoning as the OrderedBytes for [T]

source§

impl<T> OrderedBytes for ManuallyDrop<T>where T: OrderedBytes + ?Sized,

Implementors§