pub struct BandwidthProducer { /* private fields */ }Expand description
Produces bandwidth estimates, notifying consumers when the value changes.
Implementations§
Source§impl BandwidthProducer
impl BandwidthProducer
Sourcepub fn new() -> BandwidthProducer
pub fn new() -> BandwidthProducer
Create a fresh producer with no current estimate.
Sourcepub fn set(&self, bitrate: Option<u64>) -> Result<(), Error>
pub fn set(&self, bitrate: Option<u64>) -> Result<(), Error>
Set the current bandwidth estimate in bits per second.
Sourcepub fn consume(&self) -> BandwidthConsumer
pub fn consume(&self) -> BandwidthConsumer
Create a new consumer for the bandwidth estimate.
Trait Implementations§
Source§impl Clone for BandwidthProducer
impl Clone for BandwidthProducer
Source§fn clone(&self) -> BandwidthProducer
fn clone(&self) -> BandwidthProducer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for BandwidthProducer
impl Default for BandwidthProducer
Source§fn default() -> BandwidthProducer
fn default() -> BandwidthProducer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BandwidthProducer
impl RefUnwindSafe for BandwidthProducer
impl Send for BandwidthProducer
impl Sync for BandwidthProducer
impl Unpin for BandwidthProducer
impl UnsafeUnpin for BandwidthProducer
impl UnwindSafe for BandwidthProducer
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