Progress

Enum Progress 

Source
pub enum Progress {
    Section,
    Headline,
    Item,
    Bottom,
}

Variants§

§

Section

§

Headline

§

Item

§

Bottom

Implementations§

Source§

impl Progress

Source

pub fn enter<D: Display>(self, name: D) -> Self

Examples found in repository?
examples/test.rs (line 5)
3fn main() {
4    let p = cli_agenda::start();
5    let p = p.enter("Set up network");
6    p.single("Create Virtual Private Cloud");
7    p.single("Attach internet gateway");
8    let p = p.enter("Allocate subnet #1");
9    p.single("Hook in internet-enabled route table");
10    let p = p.leave();
11    p.single("Allocate subnet #2");
12    let p = p.enter("Generate VPC key-pair");
13    p.error("Could not create key-pair");
14    p.single("Attempting to delete old key-pair");
15    p.single("Attempting to generate new key-pair");
16    let p = p.root();
17
18    let p = p.enter("Launch instances");
19    p.single("Launch instances in cluster #1");
20    p.single("Launch instances in cluster #2");
21    let p = p.enter("Wait for HQ to start running");
22    p.single("Still in 'pending' state");
23    p.single("Still in 'pending' state");
24    let p = p.leave();
25    let p = p.enter("Wait for workers to reach 'running' state");
26    let p = p.enter("Wait for HQ to become pingable");
27    eprintln!("54.84.179.156 | UNREACHABLE!");
28    eprintln!("54.84.179.156 | UNREACHABLE!");
29    eprintln!("54.84.179.156 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
30    let p = p.leave();
31    let p = p.enter("Wait for workers to become pingable");
32    eprintln!("10.0.1.237 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
33    let p = p.root();
34
35    let p = p.enter("Deploy application");
36    eprintln!("PLAY [ansible-playbook]");
37    eprintln!("TASK [common : Run application]");
38    eprintln!("fatal: [10.0.1.237]: FAILED! => {{\"changed\": true, \"cmd\": ...}}");
39    eprintln!("PLAY RECAP");
40    eprintln!("10.0.1.237: ok=6    changed=4    unreachable=0    failed=1");
41    p.error("Application failed to run correctly");
42    let p = p.root();
43}
Source

pub fn leave(self) -> Progress

Examples found in repository?
examples/test.rs (line 10)
3fn main() {
4    let p = cli_agenda::start();
5    let p = p.enter("Set up network");
6    p.single("Create Virtual Private Cloud");
7    p.single("Attach internet gateway");
8    let p = p.enter("Allocate subnet #1");
9    p.single("Hook in internet-enabled route table");
10    let p = p.leave();
11    p.single("Allocate subnet #2");
12    let p = p.enter("Generate VPC key-pair");
13    p.error("Could not create key-pair");
14    p.single("Attempting to delete old key-pair");
15    p.single("Attempting to generate new key-pair");
16    let p = p.root();
17
18    let p = p.enter("Launch instances");
19    p.single("Launch instances in cluster #1");
20    p.single("Launch instances in cluster #2");
21    let p = p.enter("Wait for HQ to start running");
22    p.single("Still in 'pending' state");
23    p.single("Still in 'pending' state");
24    let p = p.leave();
25    let p = p.enter("Wait for workers to reach 'running' state");
26    let p = p.enter("Wait for HQ to become pingable");
27    eprintln!("54.84.179.156 | UNREACHABLE!");
28    eprintln!("54.84.179.156 | UNREACHABLE!");
29    eprintln!("54.84.179.156 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
30    let p = p.leave();
31    let p = p.enter("Wait for workers to become pingable");
32    eprintln!("10.0.1.237 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
33    let p = p.root();
34
35    let p = p.enter("Deploy application");
36    eprintln!("PLAY [ansible-playbook]");
37    eprintln!("TASK [common : Run application]");
38    eprintln!("fatal: [10.0.1.237]: FAILED! => {{\"changed\": true, \"cmd\": ...}}");
39    eprintln!("PLAY RECAP");
40    eprintln!("10.0.1.237: ok=6    changed=4    unreachable=0    failed=1");
41    p.error("Application failed to run correctly");
42    let p = p.root();
43}
Source

pub fn root(self) -> Progress

Examples found in repository?
examples/test.rs (line 16)
3fn main() {
4    let p = cli_agenda::start();
5    let p = p.enter("Set up network");
6    p.single("Create Virtual Private Cloud");
7    p.single("Attach internet gateway");
8    let p = p.enter("Allocate subnet #1");
9    p.single("Hook in internet-enabled route table");
10    let p = p.leave();
11    p.single("Allocate subnet #2");
12    let p = p.enter("Generate VPC key-pair");
13    p.error("Could not create key-pair");
14    p.single("Attempting to delete old key-pair");
15    p.single("Attempting to generate new key-pair");
16    let p = p.root();
17
18    let p = p.enter("Launch instances");
19    p.single("Launch instances in cluster #1");
20    p.single("Launch instances in cluster #2");
21    let p = p.enter("Wait for HQ to start running");
22    p.single("Still in 'pending' state");
23    p.single("Still in 'pending' state");
24    let p = p.leave();
25    let p = p.enter("Wait for workers to reach 'running' state");
26    let p = p.enter("Wait for HQ to become pingable");
27    eprintln!("54.84.179.156 | UNREACHABLE!");
28    eprintln!("54.84.179.156 | UNREACHABLE!");
29    eprintln!("54.84.179.156 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
30    let p = p.leave();
31    let p = p.enter("Wait for workers to become pingable");
32    eprintln!("10.0.1.237 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
33    let p = p.root();
34
35    let p = p.enter("Deploy application");
36    eprintln!("PLAY [ansible-playbook]");
37    eprintln!("TASK [common : Run application]");
38    eprintln!("fatal: [10.0.1.237]: FAILED! => {{\"changed\": true, \"cmd\": ...}}");
39    eprintln!("PLAY RECAP");
40    eprintln!("10.0.1.237: ok=6    changed=4    unreachable=0    failed=1");
41    p.error("Application failed to run correctly");
42    let p = p.root();
43}
Source

pub fn error<D: Display>(&self, msg: D)

Examples found in repository?
examples/test.rs (line 13)
3fn main() {
4    let p = cli_agenda::start();
5    let p = p.enter("Set up network");
6    p.single("Create Virtual Private Cloud");
7    p.single("Attach internet gateway");
8    let p = p.enter("Allocate subnet #1");
9    p.single("Hook in internet-enabled route table");
10    let p = p.leave();
11    p.single("Allocate subnet #2");
12    let p = p.enter("Generate VPC key-pair");
13    p.error("Could not create key-pair");
14    p.single("Attempting to delete old key-pair");
15    p.single("Attempting to generate new key-pair");
16    let p = p.root();
17
18    let p = p.enter("Launch instances");
19    p.single("Launch instances in cluster #1");
20    p.single("Launch instances in cluster #2");
21    let p = p.enter("Wait for HQ to start running");
22    p.single("Still in 'pending' state");
23    p.single("Still in 'pending' state");
24    let p = p.leave();
25    let p = p.enter("Wait for workers to reach 'running' state");
26    let p = p.enter("Wait for HQ to become pingable");
27    eprintln!("54.84.179.156 | UNREACHABLE!");
28    eprintln!("54.84.179.156 | UNREACHABLE!");
29    eprintln!("54.84.179.156 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
30    let p = p.leave();
31    let p = p.enter("Wait for workers to become pingable");
32    eprintln!("10.0.1.237 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
33    let p = p.root();
34
35    let p = p.enter("Deploy application");
36    eprintln!("PLAY [ansible-playbook]");
37    eprintln!("TASK [common : Run application]");
38    eprintln!("fatal: [10.0.1.237]: FAILED! => {{\"changed\": true, \"cmd\": ...}}");
39    eprintln!("PLAY RECAP");
40    eprintln!("10.0.1.237: ok=6    changed=4    unreachable=0    failed=1");
41    p.error("Application failed to run correctly");
42    let p = p.root();
43}
Source

pub fn warn<D: Display>(&self, msg: D)

Source

pub fn single<D: Display>(&self, name: D)

Examples found in repository?
examples/test.rs (line 6)
3fn main() {
4    let p = cli_agenda::start();
5    let p = p.enter("Set up network");
6    p.single("Create Virtual Private Cloud");
7    p.single("Attach internet gateway");
8    let p = p.enter("Allocate subnet #1");
9    p.single("Hook in internet-enabled route table");
10    let p = p.leave();
11    p.single("Allocate subnet #2");
12    let p = p.enter("Generate VPC key-pair");
13    p.error("Could not create key-pair");
14    p.single("Attempting to delete old key-pair");
15    p.single("Attempting to generate new key-pair");
16    let p = p.root();
17
18    let p = p.enter("Launch instances");
19    p.single("Launch instances in cluster #1");
20    p.single("Launch instances in cluster #2");
21    let p = p.enter("Wait for HQ to start running");
22    p.single("Still in 'pending' state");
23    p.single("Still in 'pending' state");
24    let p = p.leave();
25    let p = p.enter("Wait for workers to reach 'running' state");
26    let p = p.enter("Wait for HQ to become pingable");
27    eprintln!("54.84.179.156 | UNREACHABLE!");
28    eprintln!("54.84.179.156 | UNREACHABLE!");
29    eprintln!("54.84.179.156 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
30    let p = p.leave();
31    let p = p.enter("Wait for workers to become pingable");
32    eprintln!("10.0.1.237 | SUCCESS => {{\"changed\": false, \"ping\": \"pong\"}}");
33    let p = p.root();
34
35    let p = p.enter("Deploy application");
36    eprintln!("PLAY [ansible-playbook]");
37    eprintln!("TASK [common : Run application]");
38    eprintln!("fatal: [10.0.1.237]: FAILED! => {{\"changed\": true, \"cmd\": ...}}");
39    eprintln!("PLAY RECAP");
40    eprintln!("10.0.1.237: ok=6    changed=4    unreachable=0    failed=1");
41    p.error("Application failed to run correctly");
42    let p = p.root();
43}

Trait Implementations§

Source§

impl Clone for Progress

Source§

fn clone(&self) -> Progress

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Progress

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Progress

Source§

fn eq(&self, other: &Progress) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Progress

Source§

impl Eq for Progress

Source§

impl StructuralPartialEq for Progress

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.