[][src]Struct scuttlebutt::SyncChannel

pub struct SyncChannel<R, W> { /* fields omitted */ }

A channel that implements AbstractChannel as well as Send and Sync.

Methods

impl<R: Read, W: Write> SyncChannel<R, W>[src]

pub fn new(reader: R, writer: W) -> Self[src]

Make a new Channel from a reader and a writer.

pub fn reader(self) -> Arc<Mutex<R>>[src]

Return a reader object wrapped in Arc<Mutex<R>>.

pub fn writer(self) -> Arc<Mutex<W>>[src]

Return a writer object wrapped in Arc<Mutex<W>>.

Trait Implementations

impl<R: Read, W: Write> AbstractChannel for SyncChannel<R, W>[src]

fn write_bool(&mut self, b: bool) -> Result<()>[src]

Write a bool to the channel.

fn read_bool(&mut self) -> Result<bool>[src]

Read a bool from the channel.

fn write_usize(&mut self, s: usize) -> Result<()>[src]

Write a usize to the channel.

fn read_usize(&mut self) -> Result<usize>[src]

Read a usize from the channel.

fn write_block(&mut self, b: &Block) -> Result<()>[src]

Write a Block to the channel.

fn read_block(&mut self) -> Result<Block>[src]

Read a Block from the channel.

fn write_block512(&mut self, b: &Block512) -> Result<()>[src]

Write a Block512 to the channel.

fn read_block512(&mut self) -> Result<Block512>[src]

Read a Block512 from the channel.

fn write_pt(&mut self, pt: &RistrettoPoint) -> Result<()>[src]

Write a RistrettoPoint to the channel.

fn read_pt(&mut self) -> Result<RistrettoPoint>[src]

Read a RistrettoPoint from the channel.

Auto Trait Implementations

impl<R, W> Send for SyncChannel<R, W> where
    R: Send,
    W: Send

impl<R, W> Sync for SyncChannel<R, W> where
    R: Send,
    W: Send

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> FromCast<T> for T

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> FromBits<T> for T