Trait concordium_base::common::Buffer
source · pub trait Buffer: Sized + WriteBytesExt {
type Result;
// Required methods
fn start() -> Self;
fn result(self) -> Self::Result;
// Provided method
fn start_hint(_l: usize) -> Self { ... }
}
Expand description
Trait for writers which will not fail in normal operation with
small amounts of data, e.g., Vec<u8>
.
Moreover having a special trait allows us to implement it for
other types, such as the SHA Digest.
Required Associated Types§
Required Methods§
Provided Methods§
fn start_hint(_l: usize) -> Self
Implementations on Foreign Types§
Implementors§
source§impl Buffer for RandomOracle
impl Buffer for RandomOracle
This implementation allows the use of a random oracle without intermediate allocations of byte buffers.