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?
examples/download.rs (line 6)
5 6 7 8 9 10 11 12 13 14 15 16 17
async fn main() -> Result<()> {
let downloader = DownloaderBuilder::new("levinion", "dotfiles", "nvim")
.on_process(|process| {
println!(
"process: {}/{}\t{:.0}%",
process.current,
process.all,
process.percent() * 100.
);
})
.build();
downloader.download().await
}pub fn branch(self, branch: &str) -> Self
pub fn local_path(self, local: &str) -> Self
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)
5 6 7 8 9 10 11 12 13 14 15 16 17
async fn main() -> Result<()> {
let downloader = DownloaderBuilder::new("levinion", "dotfiles", "nvim")
.on_process(|process| {
println!(
"process: {}/{}\t{:.0}%",
process.current,
process.all,
process.percent() * 100.
);
})
.build();
downloader.download().await
}Sourcepub fn build(self) -> Downloader
pub fn build(self) -> Downloader
Examples found in repository?
examples/download.rs (line 15)
5 6 7 8 9 10 11 12 13 14 15 16 17
async fn main() -> Result<()> {
let downloader = DownloaderBuilder::new("levinion", "dotfiles", "nvim")
.on_process(|process| {
println!(
"process: {}/{}\t{:.0}%",
process.current,
process.all,
process.percent() * 100.
);
})
.build();
downloader.download().await
}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