pub struct Process {
pub current: usize,
pub all: usize,
}
Fields§
§current: usize
§all: usize
Implementations§
Source§impl Process
impl Process
Sourcepub fn percent(&self) -> f64
pub fn percent(&self) -> f64
Examples found in repository?
examples/download.rs (line 12)
5async fn main() -> Result<()> {
6 let downloader = DownloaderBuilder::new("levinion", "dotfiles", "nvim")
7 .on_process(|process| {
8 println!(
9 "process: {}/{}\t{:.0}%",
10 process.current,
11 process.all,
12 process.percent() * 100.
13 );
14 })
15 .build();
16 downloader.download().await
17}
More examples
examples/download_single.rs (line 12)
5async fn main() -> Result<()> {
6 let downloader = DownloaderBuilder::new("levinion", "dotfiles", "nvim/init.lua")
7 .on_process(|process| {
8 println!(
9 "process: {}/{}\t{:.0}%",
10 process.current,
11 process.all,
12 process.percent() * 100.
13 );
14 })
15 .build();
16 downloader.download().await
17}
examples/download_with_target.rs (line 13)
5async fn main() -> Result<()> {
6 let downloader = DownloaderBuilder::new("levinion", "dotfiles", "nvim")
7 .local_path("./src")
8 .on_process(|process| {
9 println!(
10 "process: {}/{}\t{:.0}%",
11 process.current,
12 process.all,
13 process.percent() * 100.
14 );
15 })
16 .build();
17 downloader.download().await
18}
examples/download_single_with_target.rs (line 13)
5async fn main() -> Result<()> {
6 let downloader = DownloaderBuilder::new("levinion", "dotfiles", "nvim/init.lua")
7 .local_path("./src")
8 .on_process(|process| {
9 println!(
10 "process: {}/{}\t{:.0}%",
11 process.current,
12 process.all,
13 process.percent() * 100.
14 );
15 })
16 .build();
17 downloader.download().await
18}
pub fn is_over(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Process
impl RefUnwindSafe for Process
impl Send for Process
impl Sync for Process
impl Unpin for Process
impl UnwindSafe for Process
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