[−][src]Trait git_features::progress::Progress
Associated Types
type SubProgress: Progress
Required methods
fn add_child(&mut self, name: impl Into<String>) -> Self::SubProgress
Adds a new child, whose parent is this instance, with the given name.
This will make the child progress to appear contained in the parent progress.
fn init(&mut self, max: Option<u32>, unit: Option<&'static str>)
Initialize the Item for receiving progress information.
If max
is Some(…)
, it will be treated as upper bound. When progress is set(…)
it should not exceed the given maximum.
If max
is None
, the progress is unbounded. Use this if the amount of work cannot accurately
be determined in advance.
If unit
is Some(…)
, it is used for display purposes only. It should be using the plural.
If this method is never called, this Progress
instance will serve as organizational unit, useful to add more structure
to the progress tree (e.g. a headline).
Note that this method can be called multiple times, changing the bounded-ness and unit at will.
fn set(&mut self, step: u32)
Set the current progress to the given step
. The cost of this call is negligible,
making manual throttling not necessary.
Note: that this call has no effect unless init(…)
was called before.
fn message(&mut self, level: MessageLevel, message: impl Into<String>)
Create a message
of the given level
and store it with the progress tree.
Use this to provide additional,human-readable information about the progress made, including indicating success or failure.
Provided methods
fn info(&mut self, message: impl Into<String>)
Create a message providing additional information about the progress thus far.
fn done(&mut self, message: impl Into<String>)
Create a message indicating the task is done successfully
fn fail(&mut self, message: impl Into<String>)
Create a message indicating the task failed
Implementations on Foreign Types
impl Progress for Item
[src]
type SubProgress = Item
fn add_child(&mut self, name: impl Into<String>) -> Self::SubProgress
[src]
fn init(&mut self, max: Option<u32>, unit: Option<&'static str>)
[src]
fn set(&mut self, step: u32)
[src]
fn message(&mut self, level: MessageLevel, message: impl Into<String>)
[src]
Implementors
impl Progress for Discard
[src]
type SubProgress = Discard
fn add_child(&mut self, _name: impl Into<String>) -> Self::SubProgress
[src]
fn init(&mut self, _max: Option<u32>, _unit: Option<&'static str>)
[src]
fn set(&mut self, _step: u32)
[src]
fn message(&mut self, _level: MessageLevel, _message: impl Into<String>)
[src]
impl Progress for Log
[src]
type SubProgress = Log
fn add_child(&mut self, name: impl Into<String>) -> Self::SubProgress
[src]
fn init(&mut self, max: Option<u32>, unit: Option<&'static str>)
[src]
fn set(&mut self, step: u32)
[src]
fn message(&mut self, level: MessageLevel, message: impl Into<String>)
[src]
impl<L, R> Progress for Either<L, R> where
L: Progress,
R: Progress,
[src]
L: Progress,
R: Progress,
type SubProgress = Either<L::SubProgress, R::SubProgress>
fn add_child(&mut self, name: impl Into<String>) -> Self::SubProgress
[src]
fn init(&mut self, max: Option<u32>, unit: Option<&'static str>)
[src]
fn set(&mut self, step: u32)
[src]
fn message(&mut self, level: MessageLevel, message: impl Into<String>)
[src]
impl<T> Progress for DoOrDiscard<T> where
T: Progress,
[src]
T: Progress,