zerovec::ule

Trait SliceAsULE

Source
pub trait SliceAsULE
where Self: AsULE + Sized,
{ // Required method fn slice_to_unaligned(slice: &[Self]) -> Option<&[Self::ULE]>; }
Expand description

A trait for a type where aligned slices can be cast to unaligned slices.

Auto-implemented on all types implementing EqULE.

Required Methods§

Source

fn slice_to_unaligned(slice: &[Self]) -> Option<&[Self::ULE]>

Converts from &[Self] to &[Self::ULE] if possible.

In general, this function returns Some on little-endian and None on big-endian.

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<T> SliceAsULE for T
where T: EqULE,