Skip to content

Commit

Permalink
update rust qs
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Jul 3, 2024
1 parent 4df7909 commit bffc7d8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/getting-started/rust.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<AppliesTo all />
Get started with our official cross-platform Rust Crate.

:::tip
To find the most accurate documentation for Rust please visit https://docs.rs/velopack
:::

1. Add Velopack to your `Cargo.toml`:
```toml
[dependencies]
Expand All @@ -28,7 +32,8 @@ Get started with our official cross-platform Rust Crate.
use anyhow::Result;

fn update_my_app() -> Result<()> {
let um = UpdateManager::new("https://the.place/you-host/updates", None)?;
let source = sources::HttpSource::new("https://the.place/you-host/updates");
let um = UpdateManager::new(source, None)?;

// check for updates
let updates: Option<UpdateInfo> = um.check_for_updates()?;
Expand All @@ -38,11 +43,11 @@ Get started with our official cross-platform Rust Crate.

// download updates
let updates = updates.unwrap();
um.download_updates(&updates, |progress| {
um.download_updates(&updates, |progress| {
println!("Download progress: {}%", progress);
})?;

// apply updates
// apply and restart
um.apply_updates_and_restart(&updates, RestartArgs::None)?;
Ok(())
}
Expand Down

0 comments on commit bffc7d8

Please sign in to comment.