pub struct CoderProgress { /* private fields */ }Expand description
Counts how much work a crate::Coder completed before returning.
Implementations§
Source§impl CoderProgress
impl CoderProgress
Sourcepub const fn new(
status: CoderStatus,
read: usize,
written: usize,
) -> CoderProgress
pub const fn new( status: CoderStatus, read: usize, written: usize, ) -> CoderProgress
Sourcepub const fn complete(read: usize, written: usize) -> CoderProgress
pub const fn complete(read: usize, written: usize) -> CoderProgress
Creates a completed progress value.
§Parameters
read: Number of consumed input units.written: Number of produced output units.
§Returns
Returns a progress value whose status is CoderStatus::Complete.
Sourcepub const fn status(self) -> CoderStatus
pub const fn status(self) -> CoderStatus
Sourcepub const fn read(self) -> usize
pub const fn read(self) -> usize
Returns the number of input units consumed by the call.
§Returns
Returns a count relative to the input index passed to the conversion call.
Sourcepub const fn written(self) -> usize
pub const fn written(self) -> usize
Returns the number of output units written by the call.
§Returns
Returns a count relative to the output index passed to the conversion call.
Sourcepub const fn required(self) -> usize
pub const fn required(self) -> usize
Returns the additional unit count required by the reported status.
§Returns
Returns 0 when conversion completed.
Sourcepub const fn index(self) -> Option<usize>
pub const fn index(self) -> Option<usize>
Returns the absolute boundary index associated with this status, if any.
- For
CoderStatus::NeedInput, returnsinput_index. - For
CoderStatus::NeedOutput, returnsoutput_index. - For
CoderStatus::Complete, returnsNone.
Trait Implementations§
Source§impl Clone for CoderProgress
impl Clone for CoderProgress
Source§fn clone(&self) -> CoderProgress
fn clone(&self) -> CoderProgress
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 CoderProgress
impl Debug for CoderProgress
Source§impl PartialEq for CoderProgress
impl PartialEq for CoderProgress
Source§fn eq(&self, other: &CoderProgress) -> bool
fn eq(&self, other: &CoderProgress) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CoderProgress
impl Eq for CoderProgress
impl StructuralPartialEq for CoderProgress
Auto Trait Implementations§
impl Freeze for CoderProgress
impl RefUnwindSafe for CoderProgress
impl Send for CoderProgress
impl Sync for CoderProgress
impl Unpin for CoderProgress
impl UnsafeUnpin for CoderProgress
impl UnwindSafe for CoderProgress
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