pub trait MeasureAcknowledgement {
// Required methods
fn begin_measuring(&mut self);
fn finish_measuring(&mut self);
fn add_amount(&mut self, amount: u32);
fn get_current_amount(&mut self) -> u32;
// Provided method
fn as_acknowledgement(&mut self) -> Acknowledgement { ... }
}
Expand description
§Measurement receiving chunk size.
Clients and the server are each required to send Acknowledgement
messages when received chunk sizes exceed their bandwidths.
This trait defines ways to measure receiving chunk sizes for any stream.
Required Methods§
Sourcefn begin_measuring(&mut self)
fn begin_measuring(&mut self)
Resets measured count and turns the flag into on, for beginning measurement.
Sourcefn finish_measuring(&mut self)
fn finish_measuring(&mut self)
Resets measured count and turns the flag into off, for finishing measurement.
Sourcefn add_amount(&mut self, amount: u32)
fn add_amount(&mut self, amount: u32)
Adds received chunk size to current one.
Sourcefn get_current_amount(&mut self) -> u32
fn get_current_amount(&mut self) -> u32
Gets current chunk size.
Provided Methods§
Sourcefn as_acknowledgement(&mut self) -> Acknowledgement
fn as_acknowledgement(&mut self) -> Acknowledgement
Wraps current chunk size into an Acknowledgement
message.