Skip to main content

DatagramCost

Trait DatagramCost 

pub trait DatagramCost {
    // Required method
    fn cost(&self) -> u64;
}
Available on crate feature std only.
Expand description

The intrinsic cost of a datagram-ish item: its byte length.

This is what a PacedSink charges by default. The tuple impl covers address-carrying sinks such as UdpFramed ((item, SocketAddr)).

Required Methods§

fn cost(&self) -> u64

The cost of this item, in rate units.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl DatagramCost for &[u8]

§

fn cost(&self) -> u64

§

impl DatagramCost for &str

§

fn cost(&self) -> u64

§

impl<T, A> DatagramCost for (T, A)
where T: DatagramCost,

§

fn cost(&self) -> u64

Implementors§