MCPcopy Create free account
hub / github.com/RustCrypto/utils / Sealed

Interface Sealed

block-buffer/src/sealed.rs:12–32  ·  view source on GitHub ↗

Sealed trait for buffer kinds.

Source from the content-addressed store, hash-verified

10
11/// Sealed trait for buffer kinds.
12pub 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
34impl Sealed for super::Eager {
35 type Pos = ();

Callers

nothing calls this directly

Implementers 1

sealed.rsblock-buffer/src/sealed.rs

Calls

no outgoing calls

Tested by

no test coverage detected