Sealed trait for buffer kinds.
| 10 | |
| 11 | /// Sealed trait for buffer kinds. |
| 12 | pub trait Sealed { |
| 13 | #[cfg(not(feature = "zeroize"))] |
| 14 | type Pos: Default + Clone; |
| 15 | #[cfg(feature = "zeroize")] |
| 16 | type Pos: Default + Clone + zeroize::Zeroize; |
| 17 | |
| 18 | type Overhead: ArraySize; |
| 19 | |
| 20 | const NAME: &'static str; |
| 21 | |
| 22 | fn get_pos<N: ArraySize>(buf: &Block<N>, pos: &Self::Pos) -> usize; |
| 23 | |
| 24 | fn set_pos<N: ArraySize>(buf: &mut Block<N>, pos: &mut Self::Pos, val: usize); |
| 25 | |
| 26 | /// Invariant guaranteed by a buffer kind, i.e. with correct |
| 27 | /// buffer code this function always returns true. |
| 28 | fn invariant(pos: usize, block_size: usize) -> bool; |
| 29 | |
| 30 | /// Split input data into slice of blocks and tail. |
| 31 | fn split_blocks<N: ArraySize>(data: &[u8]) -> (&[Array<u8, N>], &[u8]); |
| 32 | } |
| 33 | |
| 34 | impl Sealed for super::Eager { |
| 35 | type Pos = (); |
nothing calls this directly
no outgoing calls
no test coverage detected