Struct cargo_packager_updater::UpdaterBuilder
source · pub struct UpdaterBuilder { /* private fields */ }
Expand description
An Updater
builder.
Implementations§
source§impl UpdaterBuilder
impl UpdaterBuilder
sourcepub fn new(current_version: Version, config: Config) -> Self
pub fn new(current_version: Version, config: Config) -> Self
Create a new updater builder request.
sourcepub fn version_comparator<F: Fn(Version, RemoteRelease) -> bool + Send + Sync + 'static>(
self,
f: F
) -> Self
pub fn version_comparator<F: Fn(Version, RemoteRelease) -> bool + Send + Sync + 'static>( self, f: F ) -> Self
A custom function to compare whether a new version exists or not.
sourcepub fn pub_key(self, pub_key: impl Into<String>) -> Self
pub fn pub_key(self, pub_key: impl Into<String>) -> Self
Specify a public key to use when checking if the update is valid.
sourcepub fn target(self, target: impl Into<String>) -> Self
pub fn target(self, target: impl Into<String>) -> Self
Specify the target to request an update for.
sourcepub fn endpoints(self, endpoints: Vec<Url>) -> Self
pub fn endpoints(self, endpoints: Vec<Url>) -> Self
Specify the endpoints where an update will be requested from.
sourcepub fn executable_path<P: AsRef<Path>>(self, p: P) -> Self
pub fn executable_path<P: AsRef<Path>>(self, p: P) -> Self
Specify the path to the current executable where the updater will try to update in the same directory.
sourcepub fn header<K, V>(self, key: K, value: V) -> Result<Self>where
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
HeaderValue: TryFrom<V>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>,
pub fn header<K, V>(self, key: K, value: V) -> Result<Self>where
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
HeaderValue: TryFrom<V>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>,
Add a header to the updater request.
sourcepub fn installer_args<I, S>(self, args: I) -> Self
pub fn installer_args<I, S>(self, args: I) -> Self
Specify custom installer args on Windows.
Auto Trait Implementations§
impl !RefUnwindSafe for UpdaterBuilder
impl Send for UpdaterBuilder
impl Sync for UpdaterBuilder
impl Unpin for UpdaterBuilder
impl !UnwindSafe for UpdaterBuilder
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