Skip to main content

spl_pod/
pod_length.rs

1use {crate::error::PodSliceError, bytemuck::Pod};
2
3/// Marker trait for converting to/from Pod `uint`'s and `usize`
4pub trait PodLength: Pod + Into<usize> + TryFrom<usize> {}
5
6/// Blanket implementation to automatically implement `PodLength` for any type
7/// that satisfies the required bounds.
8impl<T> PodLength for T
9where
10    T: Pod + Into<usize> + TryFrom<usize>,
11    PodSliceError: From<<T as TryFrom<usize>>::Error>,
12{
13}