Struct self_update::backends::gitlab::UpdateBuilder[][src]

pub struct UpdateBuilder { /* fields omitted */ }

gitlab::Update builder

Configure download and installation from https://gitlab.com/api/v4/projects/<repo_owner>%2F<repo_name>/releases

Implementations

impl UpdateBuilder[src]

pub fn new() -> Self[src]

Initialize a new builder

pub fn repo_owner(&mut self, owner: &str) -> &mut Self[src]

Set the repo owner, used to build a gitlab api url

pub fn repo_name(&mut self, name: &str) -> &mut Self[src]

Set the repo name, used to build a gitlab api url

pub fn current_version(&mut self, ver: &str) -> &mut Self[src]

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

pub fn target_version_tag(&mut self, ver: &str) -> &mut Self[src]

Set the target version tag to update to. This will be used to search for a release by tag name: /repos/:owner%2F:repo/releases/:tag

If not specified, the latest available release is used.

pub fn target(&mut self, target: &str) -> &mut Self[src]

Set the target triple that will be downloaded, e.g. x86_64-unknown-linux-gnu.

If unspecified, the build target of the crate will be used

pub fn bin_name(&mut self, name: &str) -> &mut Self[src]

Set the exe’s name. Also sets bin_path_in_archive if it hasn’t already been set.

This method will append the platform specific executable file suffix (see std::env::consts::EXE_SUFFIX) to the name if it’s missing.

pub fn bin_install_path<A: AsRef<Path>>(
    &mut self,
    bin_install_path: A
) -> &mut Self
[src]

Set the installation path for the new exe, defaults to the current executable’s path

pub fn bin_path_in_archive(&mut self, bin_path: &str) -> &mut Self[src]

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")

pub fn show_download_progress(&mut self, show: bool) -> &mut Self[src]

Toggle download progress bar, defaults to off.

pub fn set_progress_style(&mut self, progress_style: ProgressStyle) -> &mut Self[src]

Toggle download progress bar, defaults to off.

pub fn show_output(&mut self, show: bool) -> &mut Self[src]

Toggle update output information, defaults to true.

pub fn no_confirm(&mut self, no_confirm: bool) -> &mut Self[src]

Toggle download confirmation. Defaults to false.

pub fn auth_token(&mut self, auth_token: &str) -> &mut Self[src]

Set the authorization token, used in requests to the gitlab api url

This is to support private repos where you need a GitHub auth token. Make sure not to bake the token into your app; it is recommended you obtain it via another mechanism, such as environment variables or prompting the user for input

pub fn build(&self) -> Result<Box<dyn ReleaseUpdate>>[src]

Confirm config and create a ready-to-use Update

  • Errors:
    • Config - Invalid Update configuration

Trait Implementations

impl Debug for UpdateBuilder[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for UpdateBuilder[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V