Struct scuttlebutt::channel::HashChannel
source · pub struct HashChannel<R, W> { /* private fields */ }
Expand description
An instantiation of the AbstractChannel
trait which computes a running
hash of all bytes read from and written to the channel.
Implementations§
Trait Implementations§
source§impl<R: Read, W: Write> AbstractChannel for HashChannel<R, W>
impl<R: Read, W: Write> AbstractChannel for HashChannel<R, W>
source§fn read_bytes(&mut self, bytes: &mut [u8]) -> Result<()>
fn read_bytes(&mut self, bytes: &mut [u8]) -> Result<()>
Read a slice of
u8
s from the channel.source§fn read_vec(&mut self, nbytes: usize) -> Result<Vec<u8>>
fn read_vec(&mut self, nbytes: usize) -> Result<Vec<u8>>
Read
nbytes
from the channel, and return it as a Vec
.source§fn read_usize(&mut self) -> Result<usize>
fn read_usize(&mut self) -> Result<usize>
Read a
usize
from the channel.source§fn read_block(&mut self) -> Result<Block>
fn read_block(&mut self) -> Result<Block>
Read a
Block
from the channel.source§fn read_block512(&mut self) -> Result<Block512>
fn read_block512(&mut self) -> Result<Block512>
Read a
Block512
from the channel.source§fn write_pt(&mut self, pt: &RistrettoPoint) -> Result<()>
fn write_pt(&mut self, pt: &RistrettoPoint) -> Result<()>
Write a
RistrettoPoint
to the channel.source§fn read_pt(&mut self) -> Result<RistrettoPoint>
fn read_pt(&mut self) -> Result<RistrettoPoint>
Read a
RistrettoPoint
from the channel.source§fn read_serializable<E: CanonicalSerialize>(&mut self) -> Result<E>
fn read_serializable<E: CanonicalSerialize>(&mut self) -> Result<E>
Read a
CanonicalSerialize
object from the channel.source§fn write_serializable<E: CanonicalSerialize>(&mut self, x: &E) -> Result<()>
fn write_serializable<E: CanonicalSerialize>(&mut self, x: &E) -> Result<()>
Write a
CanonicalSerialize
object to the channel.Auto Trait Implementations§
impl<R, W> Freeze for HashChannel<R, W>
impl<R, W> !RefUnwindSafe for HashChannel<R, W>
impl<R, W> !Send for HashChannel<R, W>
impl<R, W> !Sync for HashChannel<R, W>
impl<R, W> Unpin for HashChannel<R, W>
impl<R, W> !UnwindSafe for HashChannel<R, W>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more