pub struct UpdateBuilder { /* private fields */ }
Implementations§
Source§impl UpdateBuilder
impl UpdateBuilder
Sourcepub fn new() -> Result<UpdateBuilder>
pub fn new() -> Result<UpdateBuilder>
Initialize a new builder, defaulting the bin_install_path
to the current
executable’s path
- Errors:
- Io - Determining current exe path
pub fn release(&mut self, release: Release) -> &mut Self
Sourcepub fn current_version(&mut self, ver: &str) -> &mut Self
pub fn current_version(&mut self, ver: &str) -> &mut Self
Set the current app version, used to compare against the latest available version.
The cargo_crate_version!
macro can be used to pull the version from your Cargo.toml
Sourcepub fn bin_name(&mut self, name: &str) -> &mut Self
pub fn bin_name(&mut self, name: &str) -> &mut Self
Set the exe’s name. Also sets bin_path_in_archive
if it hasn’t already been set.
Sourcepub fn bin_install_path(&mut self, bin_install_path: &str) -> &mut Self
pub fn bin_install_path(&mut self, bin_install_path: &str) -> &mut Self
Set the installation path for the new exe, defaults to the current executable’s path
Sourcepub fn bin_path_in_archive(&mut self, bin_path: &str) -> &mut Self
pub fn bin_path_in_archive(&mut self, bin_path: &str) -> &mut Self
Set the path of the exe inside the release tarball. This is the location
of the executable relative to the base of the tar’d directory and is the
path that will be copied to the bin_install_path
. If not specified, this
will default to the value of bin_name
. This only needs to be specified if
the path to the binary (from the root of the tarball) is not equal to just
the bin_name
.
§Example
For a tarball myapp.tar.gz
with the contents:
myapp.tar/
|------- bin/
| |--- myapp # <-- executable
The path provided should be:
Update::configure()?
.bin_path_in_archive("bin/myapp")
Sourcepub fn show_download_progress(&mut self, show: bool) -> &mut Self
pub fn show_download_progress(&mut self, show: bool) -> &mut Self
Toggle download progress bar, defaults to off
.
Sourcepub fn show_output(&mut self, show: bool) -> &mut Self
pub fn show_output(&mut self, show: bool) -> &mut Self
Toggle update output information, defaults to true
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UpdateBuilder
impl RefUnwindSafe for UpdateBuilder
impl Send for UpdateBuilder
impl Sync for UpdateBuilder
impl Unpin for UpdateBuilder
impl UnwindSafe for UpdateBuilder
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
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>
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>
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