pub struct WriteReport { /* private fields */ }Expand description
Report returned by a packet writer after one outbound record.
Implementations§
Source§impl WriteReport
impl WriteReport
Sourcepub fn new(
backend: BackendKind,
bytes_requested: usize,
bytes_written: usize,
dry_run: bool,
) -> Self
pub fn new( backend: BackendKind, bytes_requested: usize, bytes_written: usize, dry_run: bool, ) -> Self
Create a write report.
Sourcepub const fn backend(&self) -> &BackendKind
pub const fn backend(&self) -> &BackendKind
Backend that handled the write.
Sourcepub const fn bytes_requested(&self) -> usize
pub const fn bytes_requested(&self) -> usize
Number of bytes requested for output.
Sourcepub const fn bytes_written(&self) -> usize
pub const fn bytes_written(&self) -> usize
Number of bytes accepted by the backend.
Sourcepub const fn is_dry_run(&self) -> bool
pub const fn is_dry_run(&self) -> bool
Return true when the write was planned without live backend emission.
Sourcepub fn target_details(&self) -> Option<&str>
pub fn target_details(&self) -> Option<&str>
Optional backend target details, such as an interface or file path.
Sourcepub fn with_target_details(self, target_details: impl Into<String>) -> Self
pub fn with_target_details(self, target_details: impl Into<String>) -> Self
Set backend target details.
Sourcepub fn clear_target_details(self) -> Self
pub fn clear_target_details(self) -> Self
Clear backend target details.
Trait Implementations§
Source§impl Clone for WriteReport
impl Clone for WriteReport
Source§fn clone(&self) -> WriteReport
fn clone(&self) -> WriteReport
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 Debug for WriteReport
impl Debug for WriteReport
impl Eq for WriteReport
Source§impl PartialEq for WriteReport
impl PartialEq for WriteReport
Source§fn eq(&self, other: &WriteReport) -> bool
fn eq(&self, other: &WriteReport) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WriteReport
Auto Trait Implementations§
impl Freeze for WriteReport
impl RefUnwindSafe for WriteReport
impl Send for WriteReport
impl Sync for WriteReport
impl Unpin for WriteReport
impl UnsafeUnpin for WriteReport
impl UnwindSafe for WriteReport
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