[−][src]Struct scuttlebutt::SyncChannel
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_bytes(&mut self, bytes: &[u8]) -> Result<()>
[src]
fn read_bytes(&mut self, bytes: &mut [u8]) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn clone(&self) -> Self
[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,
R: Send,
W: Send,
impl<R, W> Sync for SyncChannel<R, W> where
R: Send,
W: Send,
R: Send,
W: Send,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
U: FromBits<T>,
fn into_bits(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> FromCast<T> for T
fn from_cast(t: T) -> T
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,