pub struct DownloaderBuilder { /* private fields */ }
Implementations§
Source§impl DownloaderBuilder
impl DownloaderBuilder
Sourcepub fn new(user: &str, repo: &str, remote: &str) -> Self
pub fn new(user: &str, repo: &str, remote: &str) -> Self
Examples found in repository?
More examples
examples/download.rs (line 6)
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}
examples/download_single.rs (line 6)
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 6)
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 6)
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 branch(self, branch: &str) -> Self
Sourcepub fn local_path(self, local: &str) -> Self
pub fn local_path(self, local: &str) -> Self
Examples found in repository?
More examples
examples/download_with_target.rs (line 7)
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 7)
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}
Sourcepub fn on_process(self, f: fn(Process)) -> Self
pub fn on_process(self, f: fn(Process)) -> Self
Examples found in repository?
examples/download.rs (lines 7-14)
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 (lines 7-14)
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 (lines 8-15)
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 (lines 8-15)
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}
Sourcepub fn build(self) -> Downloader
pub fn build(self) -> Downloader
Examples found in repository?
More examples
examples/download.rs (line 15)
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}
examples/download_single.rs (line 15)
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 16)
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 16)
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}
Trait Implementations§
Source§impl Default for DownloaderBuilder
impl Default for DownloaderBuilder
Source§fn default() -> DownloaderBuilder
fn default() -> DownloaderBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DownloaderBuilder
impl RefUnwindSafe for DownloaderBuilder
impl Send for DownloaderBuilder
impl Sync for DownloaderBuilder
impl Unpin for DownloaderBuilder
impl UnwindSafe for DownloaderBuilder
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