pub trait AbstractChannel {
Show 26 methods fn read_bytes(&mut self, bytes: &mut [u8]) -> Result<()>; fn write_bytes(&mut self, bytes: &[u8]) -> Result<()>; fn flush(&mut self) -> Result<()>; fn clone(&self) -> Self
    where
        Self: Sized
; fn read_vec(&mut self, nbytes: usize) -> Result<Vec<u8>> { ... } fn write_bool(&mut self, b: bool) -> Result<()> { ... } fn read_bool(&mut self) -> Result<bool> { ... } fn write_u8(&mut self, s: u8) -> Result<()> { ... } fn read_u8(&mut self) -> Result<u8> { ... } fn write_u16(&mut self, s: u16) -> Result<()> { ... } fn read_u16(&mut self) -> Result<u16> { ... } fn write_u32(&mut self, s: u32) -> Result<()> { ... } fn read_u32(&mut self) -> Result<u32> { ... } fn write_u64(&mut self, s: u64) -> Result<()> { ... } fn read_u64(&mut self) -> Result<u64> { ... } fn write_usize(&mut self, s: usize) -> Result<()> { ... } fn read_usize(&mut self) -> Result<usize> { ... } fn write_block(&mut self, b: &Block) -> Result<()> { ... } fn read_block(&mut self) -> Result<Block> { ... } fn read_blocks(&mut self, n: usize) -> Result<Vec<Block>> { ... } fn write_block512(&mut self, b: &Block512) -> Result<()> { ... } fn read_block512(&mut self) -> Result<Block512> { ... } fn write_pt(&mut self, pt: &RistrettoPoint) -> Result<()> { ... } fn read_pt(&mut self) -> Result<RistrettoPoint> { ... } fn read_serializable<E: CanonicalSerialize>(&mut self) -> Result<E> { ... } fn write_serializable<E: CanonicalSerialize>(&mut self, x: &E) -> Result<()> { ... }
}
Expand description

A trait for managing I/O. AbstractChannels are clonable, and provide basic read/write capabilities for both common and scuttlebutt-specific types.

Required Methods

Read a slice of u8s from the channel.

Write a slice of u8s to the channel.

Flush the channel.

Clone the channel.

Provided Methods

Read nbytes from the channel, and return it as a Vec.

Write a bool to the channel.

Read a bool from the channel.

Write a u8 to the channel.

Read a u8 from the channel.

Write a u16 to the channel.

Read a u16 from the channel.

Write a u32 to the channel.

Read a u32 from the channel.

Write a u64 to the channel.

Read a u64 from the channel.

Write a usize to the channel.

Read a usize from the channel.

Write a Block to the channel.

Read a Block from the channel.

Read n Blocks from the channel.

Write a Block512 to the channel.

Read a Block512 from the channel.

Write a RistrettoPoint to the channel.

Read a RistrettoPoint from the channel.

Read a CanonicalSerialize object from the channel.

Write a CanonicalSerialize object to the channel.

Implementors