#[non_exhaustive]pub struct EngineConfig {Show 14 fields
pub current_version: Version,
pub minisign_public_keys: Vec<String>,
pub ed25519_public_key: Option<String>,
pub verification: Verification,
pub version_binding: VersionBinding,
pub code_signing: CodeSigning,
pub bundle_version: BundleVersion,
pub install_root: Option<PathBuf>,
pub download_dir: Option<PathBuf>,
pub max_download_size: u64,
pub deltas: bool,
pub max_delta_hops: usize,
pub http: HttpOptions,
pub install_options: InstallOptions,
}Expand description
Configuration for an UpdateEngine.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.current_version: VersionThe currently running version, compared against the source’s latest.
minisign_public_keys: Vec<String>Base64 minisign public keys. A signature made by any of them is accepted, so a new key can ship next to the old one before releases switch to it.
ed25519_public_key: Option<String>Base64 Ed25519 public key in Sparkle’s format (the SUPublicEDKey
value printed by Sparkle’s generate_keys). When set and the release
publishes an ed25519_signature, the
download is signature-checked.
verification: VerificationHow strictly downloads are verified. See Verification.
version_binding: VersionBindingWhether signatures must name the version they were made for.
code_signing: CodeSigningWhich code signature the update must carry (macOS).
bundle_version: BundleVersionWhether the update’s bundle version must equal the release (macOS).
install_root: Option<PathBuf>Where to install. Defaults to crate::install::current_install_root.
download_dir: Option<PathBuf>Directory for downloads. Defaults to a fresh temp directory that only the current user can access. A directory set here should not be writable by other users either; the engine creates it (and missing parents) with owner-only permissions if it does not exist.
max_download_size: u64Largest file, in bytes, the engine downloads: a release publishing a
larger size is refused before anything is fetched, and a body growing
past this is cut off even when no size is published. Defaults to
DEFAULT_MAX_DOWNLOAD_SIZE.
deltas: boolWhether to try published binary deltas before the full artifact.
Defaults to true; only takes effect with the delta feature on macOS
and Linux.
max_delta_hops: usizeLongest chain of deltas to download when none starts at the installed
version. Defaults to DEFAULT_MAX_DELTA_HOPS.
http: HttpOptionsExtra headers and the proxy for artifacts, deltas, and their checksum and signature files. Sources have their own.
install_options: InstallOptionsHow UpdateEngine::install installs
the update, such as the Windows Installer UI for an .msi.
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn new(current_version: Version) -> EngineConfig
pub fn new(current_version: Version) -> EngineConfig
Start a config for the given running version.
Sourcepub fn minisign_public_key(self, key: impl Into<String>) -> EngineConfig
pub fn minisign_public_key(self, key: impl Into<String>) -> EngineConfig
Trust a base64 minisign public key. Call again to trust several, for example while rotating keys.
Sourcepub fn ed25519_public_key(self, key: impl Into<String>) -> EngineConfig
pub fn ed25519_public_key(self, key: impl Into<String>) -> EngineConfig
Set the base64 Ed25519 public key (Sparkle’s SUPublicEDKey) used to
verify sparkle:edSignature signatures.
Sourcepub fn verification(self, verification: Verification) -> EngineConfig
pub fn verification(self, verification: Verification) -> EngineConfig
Set how strictly downloads are verified. Defaults to
Verification::BestEffort.
Sourcepub fn version_binding(self, binding: VersionBinding) -> EngineConfig
pub fn version_binding(self, binding: VersionBinding) -> EngineConfig
Set whether signatures must name their version. Defaults to
VersionBinding::IfPresent.
Sourcepub fn code_signing(self, code_signing: CodeSigning) -> EngineConfig
pub fn code_signing(self, code_signing: CodeSigning) -> EngineConfig
Set which code signature updates must carry. Defaults to
CodeSigning::MatchInstalled.
Sourcepub fn install_options(self, options: InstallOptions) -> EngineConfig
pub fn install_options(self, options: InstallOptions) -> EngineConfig
Set how updates are installed. Defaults to
InstallOptions::new.
Sourcepub fn bundle_version(self, bundle_version: BundleVersion) -> EngineConfig
pub fn bundle_version(self, bundle_version: BundleVersion) -> EngineConfig
Set whether bundle versions are compared. Defaults to
BundleVersion::MustMatch.
Sourcepub fn install_root(self, path: impl Into<PathBuf>) -> EngineConfig
pub fn install_root(self, path: impl Into<PathBuf>) -> EngineConfig
Override the install location (defaults to the running app/bundle).
Sourcepub fn download_dir(self, path: impl Into<PathBuf>) -> EngineConfig
pub fn download_dir(self, path: impl Into<PathBuf>) -> EngineConfig
Override the download directory (defaults to a fresh temp directory for each download).
A configured directory persists between downloads, so an artifact that an earlier download left there is reused instead of downloaded again — but only if it has the published size and passes a published checksum or signature and the payload check. Without a checksum or signature to check it against, the file is downloaded again.
Sourcepub fn max_download_size(self, bytes: u64) -> EngineConfig
pub fn max_download_size(self, bytes: u64) -> EngineConfig
Set the largest file, in bytes, the engine downloads. Defaults to
DEFAULT_MAX_DOWNLOAD_SIZE.
Sourcepub fn deltas(self, enabled: bool) -> EngineConfig
pub fn deltas(self, enabled: bool) -> EngineConfig
Enable or disable trying binary deltas before the full artifact.
Defaults to true. Has no effect without the delta feature.
Sourcepub fn max_delta_hops(self, hops: usize) -> EngineConfig
pub fn max_delta_hops(self, hops: usize) -> EngineConfig
Set the longest chain of deltas to download. 1 only uses a delta
from the installed version itself.
Sourcepub fn http(self, http: HttpOptions) -> EngineConfig
pub fn http(self, http: HttpOptions) -> EngineConfig
Download with http’s extra headers and proxy: the artifact, deltas,
and their checksum and signature files. Metadata requests use the
options set on the source.
Trait Implementations§
Source§impl Clone for EngineConfig
impl Clone for EngineConfig
Source§fn clone(&self) -> EngineConfig
fn clone(&self) -> EngineConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EngineConfig
impl RefUnwindSafe for EngineConfig
impl Send for EngineConfig
impl Sync for EngineConfig
impl Unpin for EngineConfig
impl UnsafeUnpin for EngineConfig
impl UnwindSafe for EngineConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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