Struct scuttlebutt::channel::SyncChannel
source · pub struct SyncChannel<R, W> { /* private fields */ }Expand description
A channel that implements AbstractChannel as well as Send and Sync.
Implementations§
source§impl<R: Read, W: Write> SyncChannel<R, W>
impl<R: Read, W: Write> SyncChannel<R, W>
Trait Implementations§
source§impl<R: Read, W: Write> AbstractChannel for SyncChannel<R, W>
impl<R: Read, W: Write> AbstractChannel for SyncChannel<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
u8s 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 SyncChannel<R, W>
impl<R, W> RefUnwindSafe for SyncChannel<R, W>
impl<R, W> Send for SyncChannel<R, W>
impl<R, W> Sync for SyncChannel<R, W>
impl<R, W> Unpin for SyncChannel<R, W>
impl<R, W> UnwindSafe for SyncChannel<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