pub trait Writer: Send {
// Required method
fn send_frame(&mut self, data: &[u8]) -> Result<()>;
// Provided methods
fn send_frames(&mut self, frames: &[Vec<u8>]) -> Result<()> { ... }
fn flush(&mut self) -> Result<()> { ... }
fn egress_control(&self) -> Option<EgressControl> { ... }
fn shutdown(&mut self) { ... }
}Expand description
Writable end of an interface. Held by the driver.
Each implementation wraps a socket + framing.
Required Methods§
fn send_frame(&mut self, data: &[u8]) -> Result<()>
Provided Methods§
fn send_frames(&mut self, frames: &[Vec<u8>]) -> Result<()>
Sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Resume bytes accepted by a previous call that returned WouldBlock.
Sourcefn egress_control(&self) -> Option<EgressControl>
fn egress_control(&self) -> Option<EgressControl>
Share an exact byte admission budget with the async producer when this writer uses dataplane egress control.
fn shutdown(&mut self)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".