pub struct RowManager { /* private fields */ }
Expand description
RowManager allows to store and update many progress bars.
nrows
is the number of progress bars to display at once.
All other bars are hidden and visible once any active progress bar is completed.
Traces of progress are left in terminal if leave
is true
else progress bar is cleared.
§Note
Cursor positions are not restored by RowManager.
§Example
use kdam::{tqdm, BarExt, RowManager};
let mut manager = RowManager::new(3);
let pb_index = manager.push(tqdm!(total = 100)).unwrap();
for _ in 0..100 {
manager.get_mut(pb_index).unwrap().update(1).unwrap();
manager.notify(pb_index).unwrap();
}
manager.remove(pb_index);
Implementations§
Source§impl RowManager
impl RowManager
Sourcepub fn new(nrows: u16) -> Self
pub fn new(nrows: u16) -> Self
Create a new RowManager with specified number of rows.
§Example
use kdam::RowManager;
// Display 3 progress bars at once.
let manager = RowManager::new(3);
Examples found in repository?
examples/multiple/row_manager_keep.rs (line 13)
9fn main() -> Result<()> {
10 term::init(false);
11 term::hide_cursor()?;
12
13 let mut manager = RowManager::new(3);
14
15 for (i, total) in [150, 100, 200, 400, 500, 600].iter().enumerate() {
16 manager.push(tqdm!(
17 total = *total,
18 desc = format!("BAR {}", i),
19 force_refresh = true
20 ))?;
21 }
22
23 let manager = Arc::new(Mutex::new(manager));
24
25 let manager1 = manager.clone();
26 let thread1 = thread::spawn(move || {
27 for _ in 0..150 {
28 thread::sleep(Duration::from_secs_f32(0.02));
29 let mut manager = manager1.lock().unwrap();
30 manager.get_mut(0).unwrap().update(1).unwrap();
31 manager.notify(0).unwrap();
32 }
33 });
34
35 let manager2 = manager.clone();
36 let thread2 = thread::spawn(move || {
37 for _ in 0..100 {
38 thread::sleep(Duration::from_secs_f32(0.02));
39 let mut manager = manager2.lock().unwrap();
40 manager.get_mut(1).unwrap().update(1).unwrap();
41 manager.notify(1).unwrap();
42 }
43 });
44
45 let manager3 = manager.clone();
46 let thread3 = thread::spawn(move || {
47 for _ in 0..200 {
48 thread::sleep(Duration::from_secs_f32(0.02));
49 let mut manager = manager3.lock().unwrap();
50 manager.get_mut(2).unwrap().update(1).unwrap();
51 manager.notify(2).unwrap();
52 }
53 });
54
55 let manager4 = manager.clone();
56 let thread4 = thread::spawn(move || {
57 for _ in 0..400 {
58 thread::sleep(Duration::from_secs_f32(0.02));
59 let mut manager = manager4.lock().unwrap();
60 manager.get_mut(3).unwrap().update(1).unwrap();
61 manager.notify(3).unwrap();
62 }
63 });
64
65 let manager5 = manager.clone();
66 let thread5 = thread::spawn(move || {
67 for _ in 0..500 {
68 thread::sleep(Duration::from_secs_f32(0.02));
69 let mut manager = manager5.lock().unwrap();
70 manager.get_mut(4).unwrap().update(1).unwrap();
71 manager.notify(4).unwrap();
72 }
73 });
74
75 let manager6 = manager;
76 let thread6 = thread::spawn(move || {
77 for _ in 0..600 {
78 thread::sleep(Duration::from_secs_f32(0.02));
79 let mut manager = manager6.lock().unwrap();
80 manager.get_mut(5).unwrap().update(1).unwrap();
81 manager.notify(5).unwrap();
82 }
83 });
84
85 for thread in [thread1, thread2, thread3, thread4, thread5, thread6] {
86 thread.join().unwrap();
87 }
88
89 println!("\rcompleted!");
90 Ok(())
91}
More examples
examples/multiple/row_manager_clean.rs (line 13)
9fn main() -> Result<()> {
10 term::init(false);
11 term::hide_cursor()?;
12
13 let mut manager = RowManager::new(3);
14
15 for (i, total) in [150, 100, 200, 400, 500, 600].iter().enumerate() {
16 manager.push(tqdm!(
17 total = *total,
18 leave = false,
19 desc = format!("BAR {}", i),
20 force_refresh = true
21 ))?;
22 }
23
24 let manager = Arc::new(Mutex::new(manager));
25
26 let manager1 = manager.clone();
27 let thread1 = thread::spawn(move || {
28 for _ in 0..150 {
29 thread::sleep(Duration::from_secs_f32(0.02));
30 let mut manager = manager1.lock().unwrap();
31 manager.get_mut(0).unwrap().update(1).unwrap();
32 manager.notify(0).unwrap();
33 }
34 });
35
36 let manager2 = manager.clone();
37 let thread2 = thread::spawn(move || {
38 for _ in 0..100 {
39 thread::sleep(Duration::from_secs_f32(0.02));
40 let mut manager = manager2.lock().unwrap();
41 manager.get_mut(1).unwrap().update(1).unwrap();
42 manager.notify(1).unwrap();
43 }
44 });
45
46 let manager3 = manager.clone();
47 let thread3 = thread::spawn(move || {
48 for _ in 0..200 {
49 thread::sleep(Duration::from_secs_f32(0.02));
50 let mut manager = manager3.lock().unwrap();
51 manager.get_mut(2).unwrap().update(1).unwrap();
52 manager.notify(2).unwrap();
53 }
54 });
55
56 let manager4 = manager.clone();
57 let thread4 = thread::spawn(move || {
58 for _ in 0..400 {
59 thread::sleep(Duration::from_secs_f32(0.02));
60 let mut manager = manager4.lock().unwrap();
61 manager.get_mut(3).unwrap().update(1).unwrap();
62 manager.notify(3).unwrap();
63 }
64 });
65
66 let manager5 = manager.clone();
67 let thread5 = thread::spawn(move || {
68 for _ in 0..500 {
69 thread::sleep(Duration::from_secs_f32(0.02));
70 let mut manager = manager5.lock().unwrap();
71 manager.get_mut(4).unwrap().update(1).unwrap();
72 manager.notify(4).unwrap();
73 }
74 });
75
76 let manager6 = manager;
77 let thread6 = thread::spawn(move || {
78 for _ in 0..600 {
79 thread::sleep(Duration::from_secs_f32(0.02));
80 let mut manager = manager6.lock().unwrap();
81 manager.get_mut(5).unwrap().update(1).unwrap();
82 manager.notify(5).unwrap();
83 }
84 });
85
86 for thread in [thread1, thread2, thread3, thread4, thread5, thread6] {
87 thread.join().unwrap();
88 }
89
90 println!("\rcompleted!");
91 Ok(())
92}
Sourcepub fn from_window_size() -> Self
pub fn from_window_size() -> Self
Create a new RowManager from terminal window size.
§Example
use kdam::RowManager;
let mut manager = RowManager::from_window_size();
Sourcepub fn push(&mut self, pb: Bar) -> Result<usize>
pub fn push(&mut self, pb: Bar) -> Result<usize>
Push a progress bar returning back it’s index.
Examples found in repository?
examples/multiple/row_manager_keep.rs (lines 16-20)
9fn main() -> Result<()> {
10 term::init(false);
11 term::hide_cursor()?;
12
13 let mut manager = RowManager::new(3);
14
15 for (i, total) in [150, 100, 200, 400, 500, 600].iter().enumerate() {
16 manager.push(tqdm!(
17 total = *total,
18 desc = format!("BAR {}", i),
19 force_refresh = true
20 ))?;
21 }
22
23 let manager = Arc::new(Mutex::new(manager));
24
25 let manager1 = manager.clone();
26 let thread1 = thread::spawn(move || {
27 for _ in 0..150 {
28 thread::sleep(Duration::from_secs_f32(0.02));
29 let mut manager = manager1.lock().unwrap();
30 manager.get_mut(0).unwrap().update(1).unwrap();
31 manager.notify(0).unwrap();
32 }
33 });
34
35 let manager2 = manager.clone();
36 let thread2 = thread::spawn(move || {
37 for _ in 0..100 {
38 thread::sleep(Duration::from_secs_f32(0.02));
39 let mut manager = manager2.lock().unwrap();
40 manager.get_mut(1).unwrap().update(1).unwrap();
41 manager.notify(1).unwrap();
42 }
43 });
44
45 let manager3 = manager.clone();
46 let thread3 = thread::spawn(move || {
47 for _ in 0..200 {
48 thread::sleep(Duration::from_secs_f32(0.02));
49 let mut manager = manager3.lock().unwrap();
50 manager.get_mut(2).unwrap().update(1).unwrap();
51 manager.notify(2).unwrap();
52 }
53 });
54
55 let manager4 = manager.clone();
56 let thread4 = thread::spawn(move || {
57 for _ in 0..400 {
58 thread::sleep(Duration::from_secs_f32(0.02));
59 let mut manager = manager4.lock().unwrap();
60 manager.get_mut(3).unwrap().update(1).unwrap();
61 manager.notify(3).unwrap();
62 }
63 });
64
65 let manager5 = manager.clone();
66 let thread5 = thread::spawn(move || {
67 for _ in 0..500 {
68 thread::sleep(Duration::from_secs_f32(0.02));
69 let mut manager = manager5.lock().unwrap();
70 manager.get_mut(4).unwrap().update(1).unwrap();
71 manager.notify(4).unwrap();
72 }
73 });
74
75 let manager6 = manager;
76 let thread6 = thread::spawn(move || {
77 for _ in 0..600 {
78 thread::sleep(Duration::from_secs_f32(0.02));
79 let mut manager = manager6.lock().unwrap();
80 manager.get_mut(5).unwrap().update(1).unwrap();
81 manager.notify(5).unwrap();
82 }
83 });
84
85 for thread in [thread1, thread2, thread3, thread4, thread5, thread6] {
86 thread.join().unwrap();
87 }
88
89 println!("\rcompleted!");
90 Ok(())
91}
More examples
examples/multiple/row_manager_clean.rs (lines 16-21)
9fn main() -> Result<()> {
10 term::init(false);
11 term::hide_cursor()?;
12
13 let mut manager = RowManager::new(3);
14
15 for (i, total) in [150, 100, 200, 400, 500, 600].iter().enumerate() {
16 manager.push(tqdm!(
17 total = *total,
18 leave = false,
19 desc = format!("BAR {}", i),
20 force_refresh = true
21 ))?;
22 }
23
24 let manager = Arc::new(Mutex::new(manager));
25
26 let manager1 = manager.clone();
27 let thread1 = thread::spawn(move || {
28 for _ in 0..150 {
29 thread::sleep(Duration::from_secs_f32(0.02));
30 let mut manager = manager1.lock().unwrap();
31 manager.get_mut(0).unwrap().update(1).unwrap();
32 manager.notify(0).unwrap();
33 }
34 });
35
36 let manager2 = manager.clone();
37 let thread2 = thread::spawn(move || {
38 for _ in 0..100 {
39 thread::sleep(Duration::from_secs_f32(0.02));
40 let mut manager = manager2.lock().unwrap();
41 manager.get_mut(1).unwrap().update(1).unwrap();
42 manager.notify(1).unwrap();
43 }
44 });
45
46 let manager3 = manager.clone();
47 let thread3 = thread::spawn(move || {
48 for _ in 0..200 {
49 thread::sleep(Duration::from_secs_f32(0.02));
50 let mut manager = manager3.lock().unwrap();
51 manager.get_mut(2).unwrap().update(1).unwrap();
52 manager.notify(2).unwrap();
53 }
54 });
55
56 let manager4 = manager.clone();
57 let thread4 = thread::spawn(move || {
58 for _ in 0..400 {
59 thread::sleep(Duration::from_secs_f32(0.02));
60 let mut manager = manager4.lock().unwrap();
61 manager.get_mut(3).unwrap().update(1).unwrap();
62 manager.notify(3).unwrap();
63 }
64 });
65
66 let manager5 = manager.clone();
67 let thread5 = thread::spawn(move || {
68 for _ in 0..500 {
69 thread::sleep(Duration::from_secs_f32(0.02));
70 let mut manager = manager5.lock().unwrap();
71 manager.get_mut(4).unwrap().update(1).unwrap();
72 manager.notify(4).unwrap();
73 }
74 });
75
76 let manager6 = manager;
77 let thread6 = thread::spawn(move || {
78 for _ in 0..600 {
79 thread::sleep(Duration::from_secs_f32(0.02));
80 let mut manager = manager6.lock().unwrap();
81 manager.get_mut(5).unwrap().update(1).unwrap();
82 manager.notify(5).unwrap();
83 }
84 });
85
86 for thread in [thread1, thread2, thread3, thread4, thread5, thread6] {
87 thread.join().unwrap();
88 }
89
90 println!("\rcompleted!");
91 Ok(())
92}
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut Bar>
pub fn get_mut(&mut self, index: usize) -> Option<&mut Bar>
Returns a mutable reference to progress bar.
Examples found in repository?
examples/multiple/row_manager_keep.rs (line 30)
9fn main() -> Result<()> {
10 term::init(false);
11 term::hide_cursor()?;
12
13 let mut manager = RowManager::new(3);
14
15 for (i, total) in [150, 100, 200, 400, 500, 600].iter().enumerate() {
16 manager.push(tqdm!(
17 total = *total,
18 desc = format!("BAR {}", i),
19 force_refresh = true
20 ))?;
21 }
22
23 let manager = Arc::new(Mutex::new(manager));
24
25 let manager1 = manager.clone();
26 let thread1 = thread::spawn(move || {
27 for _ in 0..150 {
28 thread::sleep(Duration::from_secs_f32(0.02));
29 let mut manager = manager1.lock().unwrap();
30 manager.get_mut(0).unwrap().update(1).unwrap();
31 manager.notify(0).unwrap();
32 }
33 });
34
35 let manager2 = manager.clone();
36 let thread2 = thread::spawn(move || {
37 for _ in 0..100 {
38 thread::sleep(Duration::from_secs_f32(0.02));
39 let mut manager = manager2.lock().unwrap();
40 manager.get_mut(1).unwrap().update(1).unwrap();
41 manager.notify(1).unwrap();
42 }
43 });
44
45 let manager3 = manager.clone();
46 let thread3 = thread::spawn(move || {
47 for _ in 0..200 {
48 thread::sleep(Duration::from_secs_f32(0.02));
49 let mut manager = manager3.lock().unwrap();
50 manager.get_mut(2).unwrap().update(1).unwrap();
51 manager.notify(2).unwrap();
52 }
53 });
54
55 let manager4 = manager.clone();
56 let thread4 = thread::spawn(move || {
57 for _ in 0..400 {
58 thread::sleep(Duration::from_secs_f32(0.02));
59 let mut manager = manager4.lock().unwrap();
60 manager.get_mut(3).unwrap().update(1).unwrap();
61 manager.notify(3).unwrap();
62 }
63 });
64
65 let manager5 = manager.clone();
66 let thread5 = thread::spawn(move || {
67 for _ in 0..500 {
68 thread::sleep(Duration::from_secs_f32(0.02));
69 let mut manager = manager5.lock().unwrap();
70 manager.get_mut(4).unwrap().update(1).unwrap();
71 manager.notify(4).unwrap();
72 }
73 });
74
75 let manager6 = manager;
76 let thread6 = thread::spawn(move || {
77 for _ in 0..600 {
78 thread::sleep(Duration::from_secs_f32(0.02));
79 let mut manager = manager6.lock().unwrap();
80 manager.get_mut(5).unwrap().update(1).unwrap();
81 manager.notify(5).unwrap();
82 }
83 });
84
85 for thread in [thread1, thread2, thread3, thread4, thread5, thread6] {
86 thread.join().unwrap();
87 }
88
89 println!("\rcompleted!");
90 Ok(())
91}
More examples
examples/multiple/row_manager_clean.rs (line 31)
9fn main() -> Result<()> {
10 term::init(false);
11 term::hide_cursor()?;
12
13 let mut manager = RowManager::new(3);
14
15 for (i, total) in [150, 100, 200, 400, 500, 600].iter().enumerate() {
16 manager.push(tqdm!(
17 total = *total,
18 leave = false,
19 desc = format!("BAR {}", i),
20 force_refresh = true
21 ))?;
22 }
23
24 let manager = Arc::new(Mutex::new(manager));
25
26 let manager1 = manager.clone();
27 let thread1 = thread::spawn(move || {
28 for _ in 0..150 {
29 thread::sleep(Duration::from_secs_f32(0.02));
30 let mut manager = manager1.lock().unwrap();
31 manager.get_mut(0).unwrap().update(1).unwrap();
32 manager.notify(0).unwrap();
33 }
34 });
35
36 let manager2 = manager.clone();
37 let thread2 = thread::spawn(move || {
38 for _ in 0..100 {
39 thread::sleep(Duration::from_secs_f32(0.02));
40 let mut manager = manager2.lock().unwrap();
41 manager.get_mut(1).unwrap().update(1).unwrap();
42 manager.notify(1).unwrap();
43 }
44 });
45
46 let manager3 = manager.clone();
47 let thread3 = thread::spawn(move || {
48 for _ in 0..200 {
49 thread::sleep(Duration::from_secs_f32(0.02));
50 let mut manager = manager3.lock().unwrap();
51 manager.get_mut(2).unwrap().update(1).unwrap();
52 manager.notify(2).unwrap();
53 }
54 });
55
56 let manager4 = manager.clone();
57 let thread4 = thread::spawn(move || {
58 for _ in 0..400 {
59 thread::sleep(Duration::from_secs_f32(0.02));
60 let mut manager = manager4.lock().unwrap();
61 manager.get_mut(3).unwrap().update(1).unwrap();
62 manager.notify(3).unwrap();
63 }
64 });
65
66 let manager5 = manager.clone();
67 let thread5 = thread::spawn(move || {
68 for _ in 0..500 {
69 thread::sleep(Duration::from_secs_f32(0.02));
70 let mut manager = manager5.lock().unwrap();
71 manager.get_mut(4).unwrap().update(1).unwrap();
72 manager.notify(4).unwrap();
73 }
74 });
75
76 let manager6 = manager;
77 let thread6 = thread::spawn(move || {
78 for _ in 0..600 {
79 thread::sleep(Duration::from_secs_f32(0.02));
80 let mut manager = manager6.lock().unwrap();
81 manager.get_mut(5).unwrap().update(1).unwrap();
82 manager.notify(5).unwrap();
83 }
84 });
85
86 for thread in [thread1, thread2, thread3, thread4, thread5, thread6] {
87 thread.join().unwrap();
88 }
89
90 println!("\rcompleted!");
91 Ok(())
92}
Sourcepub fn notify(&mut self, index: usize) -> Result<()>
pub fn notify(&mut self, index: usize) -> Result<()>
Update and print the required stuff for progress bar at that index.
§Panics
If index
is out of bounds.
Examples found in repository?
examples/multiple/row_manager_keep.rs (line 31)
9fn main() -> Result<()> {
10 term::init(false);
11 term::hide_cursor()?;
12
13 let mut manager = RowManager::new(3);
14
15 for (i, total) in [150, 100, 200, 400, 500, 600].iter().enumerate() {
16 manager.push(tqdm!(
17 total = *total,
18 desc = format!("BAR {}", i),
19 force_refresh = true
20 ))?;
21 }
22
23 let manager = Arc::new(Mutex::new(manager));
24
25 let manager1 = manager.clone();
26 let thread1 = thread::spawn(move || {
27 for _ in 0..150 {
28 thread::sleep(Duration::from_secs_f32(0.02));
29 let mut manager = manager1.lock().unwrap();
30 manager.get_mut(0).unwrap().update(1).unwrap();
31 manager.notify(0).unwrap();
32 }
33 });
34
35 let manager2 = manager.clone();
36 let thread2 = thread::spawn(move || {
37 for _ in 0..100 {
38 thread::sleep(Duration::from_secs_f32(0.02));
39 let mut manager = manager2.lock().unwrap();
40 manager.get_mut(1).unwrap().update(1).unwrap();
41 manager.notify(1).unwrap();
42 }
43 });
44
45 let manager3 = manager.clone();
46 let thread3 = thread::spawn(move || {
47 for _ in 0..200 {
48 thread::sleep(Duration::from_secs_f32(0.02));
49 let mut manager = manager3.lock().unwrap();
50 manager.get_mut(2).unwrap().update(1).unwrap();
51 manager.notify(2).unwrap();
52 }
53 });
54
55 let manager4 = manager.clone();
56 let thread4 = thread::spawn(move || {
57 for _ in 0..400 {
58 thread::sleep(Duration::from_secs_f32(0.02));
59 let mut manager = manager4.lock().unwrap();
60 manager.get_mut(3).unwrap().update(1).unwrap();
61 manager.notify(3).unwrap();
62 }
63 });
64
65 let manager5 = manager.clone();
66 let thread5 = thread::spawn(move || {
67 for _ in 0..500 {
68 thread::sleep(Duration::from_secs_f32(0.02));
69 let mut manager = manager5.lock().unwrap();
70 manager.get_mut(4).unwrap().update(1).unwrap();
71 manager.notify(4).unwrap();
72 }
73 });
74
75 let manager6 = manager;
76 let thread6 = thread::spawn(move || {
77 for _ in 0..600 {
78 thread::sleep(Duration::from_secs_f32(0.02));
79 let mut manager = manager6.lock().unwrap();
80 manager.get_mut(5).unwrap().update(1).unwrap();
81 manager.notify(5).unwrap();
82 }
83 });
84
85 for thread in [thread1, thread2, thread3, thread4, thread5, thread6] {
86 thread.join().unwrap();
87 }
88
89 println!("\rcompleted!");
90 Ok(())
91}
More examples
examples/multiple/row_manager_clean.rs (line 32)
9fn main() -> Result<()> {
10 term::init(false);
11 term::hide_cursor()?;
12
13 let mut manager = RowManager::new(3);
14
15 for (i, total) in [150, 100, 200, 400, 500, 600].iter().enumerate() {
16 manager.push(tqdm!(
17 total = *total,
18 leave = false,
19 desc = format!("BAR {}", i),
20 force_refresh = true
21 ))?;
22 }
23
24 let manager = Arc::new(Mutex::new(manager));
25
26 let manager1 = manager.clone();
27 let thread1 = thread::spawn(move || {
28 for _ in 0..150 {
29 thread::sleep(Duration::from_secs_f32(0.02));
30 let mut manager = manager1.lock().unwrap();
31 manager.get_mut(0).unwrap().update(1).unwrap();
32 manager.notify(0).unwrap();
33 }
34 });
35
36 let manager2 = manager.clone();
37 let thread2 = thread::spawn(move || {
38 for _ in 0..100 {
39 thread::sleep(Duration::from_secs_f32(0.02));
40 let mut manager = manager2.lock().unwrap();
41 manager.get_mut(1).unwrap().update(1).unwrap();
42 manager.notify(1).unwrap();
43 }
44 });
45
46 let manager3 = manager.clone();
47 let thread3 = thread::spawn(move || {
48 for _ in 0..200 {
49 thread::sleep(Duration::from_secs_f32(0.02));
50 let mut manager = manager3.lock().unwrap();
51 manager.get_mut(2).unwrap().update(1).unwrap();
52 manager.notify(2).unwrap();
53 }
54 });
55
56 let manager4 = manager.clone();
57 let thread4 = thread::spawn(move || {
58 for _ in 0..400 {
59 thread::sleep(Duration::from_secs_f32(0.02));
60 let mut manager = manager4.lock().unwrap();
61 manager.get_mut(3).unwrap().update(1).unwrap();
62 manager.notify(3).unwrap();
63 }
64 });
65
66 let manager5 = manager.clone();
67 let thread5 = thread::spawn(move || {
68 for _ in 0..500 {
69 thread::sleep(Duration::from_secs_f32(0.02));
70 let mut manager = manager5.lock().unwrap();
71 manager.get_mut(4).unwrap().update(1).unwrap();
72 manager.notify(4).unwrap();
73 }
74 });
75
76 let manager6 = manager;
77 let thread6 = thread::spawn(move || {
78 for _ in 0..600 {
79 thread::sleep(Duration::from_secs_f32(0.02));
80 let mut manager = manager6.lock().unwrap();
81 manager.get_mut(5).unwrap().update(1).unwrap();
82 manager.notify(5).unwrap();
83 }
84 });
85
86 for thread in [thread1, thread2, thread3, thread4, thread5, thread6] {
87 thread.join().unwrap();
88 }
89
90 println!("\rcompleted!");
91 Ok(())
92}
Auto Trait Implementations§
impl Freeze for RowManager
impl !RefUnwindSafe for RowManager
impl Send for RowManager
impl Sync for RowManager
impl Unpin for RowManager
impl UnwindSafe for RowManager
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more