Struct scuttlebutt::channel::TrackChannel
source · pub struct TrackChannel<C>(/* private fields */);
Expand description
A channel wrapping another channel for tracking the number of bits read/written.
Implementations§
source§impl<C: AbstractChannel> TrackChannel<C>
impl<C: AbstractChannel> TrackChannel<C>
sourcepub fn kilobits_written(&self) -> f64
pub fn kilobits_written(&self) -> f64
Return the number of kilobits written to the channel.
sourcepub fn kilobits_read(&self) -> f64
pub fn kilobits_read(&self) -> f64
Return the number of kilobits read from the channel.
sourcepub fn total_kilobits(&self) -> f64
pub fn total_kilobits(&self) -> f64
Return the total amount of communication on the channel.
sourcepub fn kilobytes_written(&self) -> f64
pub fn kilobytes_written(&self) -> f64
Return the number of kilobytes written to the channel.
sourcepub fn kilobytes_read(&self) -> f64
pub fn kilobytes_read(&self) -> f64
Return the number of kilobytes read from the channel.
sourcepub fn total_kilobytes(&self) -> f64
pub fn total_kilobytes(&self) -> f64
Return the total amount of communication on the channel as kilobytes.
Trait Implementations§
source§impl<C: AbstractChannel> AbstractChannel for TrackChannel<C>
impl<C: AbstractChannel> AbstractChannel for TrackChannel<C>
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<C> Freeze for TrackChannel<C>
impl<C> RefUnwindSafe for TrackChannel<C>
impl<C> Send for TrackChannel<C>where
C: Send,
impl<C> Sync for TrackChannel<C>where
C: Send,
impl<C> Unpin for TrackChannel<C>
impl<C> UnwindSafe for TrackChannel<C>
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