Struct git_features::progress::DoOrDiscard [−][src]
pub struct DoOrDiscard<T>(_);
An implementation of Progress which can be created easily from Option<impl Progress>.
Implementations
impl<T> DoOrDiscard<T> where
T: Progress, [src]
impl<T> DoOrDiscard<T> where
T: Progress, [src]Trait Implementations
impl<T> From<Option<T>> for DoOrDiscard<T> where
T: Progress, [src]
impl<T> From<Option<T>> for DoOrDiscard<T> where
T: Progress, [src]pub fn from(p: Option<T>) -> DoOrDiscard<T>[src]
pub fn from(p: Option<T>) -> DoOrDiscard<T>[src]Performs the conversion.
impl<T> Progress for DoOrDiscard<T> where
T: Progress, [src]
impl<T> Progress for DoOrDiscard<T> where
T: Progress, [src]type SubProgress = DoOrDiscard<<T as Progress>::SubProgress>
type SubProgress = DoOrDiscard<<T as Progress>::SubProgress>The type of progress returned by add_child().
pub fn add_child(
&mut self,
name: impl Into<String>
) -> <DoOrDiscard<T> as Progress>::SubProgress[src]
pub fn add_child(
&mut self,
name: impl Into<String>
) -> <DoOrDiscard<T> as Progress>::SubProgress[src]Adds a new child, whose parent is this instance, with the given name. Read more
pub fn init(&mut self, max: Option<usize>, unit: Option<Unit>)[src]
pub fn init(&mut self, max: Option<usize>, unit: Option<Unit>)[src]Initialize the Item for receiving progress information. Read more
pub fn set(&mut self, step: usize)[src]
pub fn set(&mut self, step: usize)[src]Set the current progress to the given step. The cost of this call is negligible,
making manual throttling not necessary. Read more
pub fn max(&self) -> Option<usize>[src]
pub fn max(&self) -> Option<usize>[src]Returns the maximum about of items we expect, as provided with the init(…) call
pub fn inc_by(&mut self, step: usize)[src]
pub fn inc_by(&mut self, step: usize)[src]Increment the current progress to the given step.
The cost of this call is negligible, making manual throttling not necessary. Read more
pub fn set_name(&mut self, name: impl Into<String>)[src]
pub fn set_name(&mut self, name: impl Into<String>)[src]Set the name of the instance, altering the value given when crating it with add_child(…)
The progress is allowed to discard it. Read more
pub fn name(&self) -> Option<String>[src]
pub fn name(&self) -> Option<String>[src]Get the name of the instance as given when creating it with add_child(…)
The progress is allowed to not be named, thus there is no guarantee that a previously set names ‘sticks’. Read more
pub fn message(&mut self, level: MessageLevel, message: impl Into<String>)[src]
pub fn message(&mut self, level: MessageLevel, message: impl Into<String>)[src]Create a message of the given level and store it with the progress tree. Read more
fn inc(&mut self)[src]
fn inc(&mut self)[src]Increment the current progress to the given 1. The cost of this call is negligible, making manual throttling not necessary. Read more
fn info(&mut self, message: impl Into<String>)[src]
fn info(&mut self, message: impl Into<String>)[src]Create a message providing additional information about the progress thus far.
fn done(&mut self, message: impl Into<String>)[src]
fn done(&mut self, message: impl Into<String>)[src]Create a message indicating the task is done successfully
fn show_throughput(&mut self, start: Instant)[src]
fn show_throughput(&mut self, start: Instant)[src]A shorthand to print throughput information
fn show_throughput_with(&mut self, start: Instant, step: usize, unit: Unit)[src]
fn show_throughput_with(&mut self, start: Instant, step: usize, unit: Unit)[src]A shorthand to print throughput information, with the given step and unit
Auto Trait Implementations
impl<T> RefUnwindSafe for DoOrDiscard<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for DoOrDiscard<T> where
T: Send,
T: Send,
impl<T> Sync for DoOrDiscard<T> where
T: Sync,
T: Sync,
impl<T> Unpin for DoOrDiscard<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for DoOrDiscard<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for Timpl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self