pub struct AppcastSource { /* private fields */ }Expand description
Reads releases from a Sparkle appcast.
The source picks the highest-versioned <item> that applies to the running
system, then the best <enclosure> in it for this platform (see
os). Items are skipped when they:
- are
sparkle:informationalUpdateitems (nothing to install); - are on a
sparkle:channelthat was not allowed withchannel; - list
arm64insparkle:hardwareRequirementsand the machine cannot run arm64 code; - fall outside
sparkle:minimumSystemVersion/sparkle:maximumSystemVersion(checked on macOS, or wherever asystem_versionis set); - have a version that is not a version this crate can order (see
AppcastVersion).
The enclosure’s sparkle:edSignature becomes
Release::ed25519_signature, so a release verifies against the app’s
SUPublicEDKey once it is set as
EngineConfig::ed25519_public_key.
An optional gpui-updater:sha256 enclosure attribute (namespace
https://github.com/AprilNEA/gpui-updater) supplies a checksum for the
Checksum and
Strict policies.
Phased rollouts, critical updates, sparkle:minimumAutoupdateVersion, and
delta enclosures are Sparkle features; this source ignores them and always
offers the full archive.
use gpui_updater_core::{AppcastSource, EngineConfig, Verification};
let source = AppcastSource::new("https://dl.example.com/appcast.xml").channel("beta");
let config = EngineConfig::new(Version::new(1, 2, 0))
.ed25519_public_key("pfIShU4dEXqPd5ObYNfDBiQWcXozk7estwzTnF9BamQ=")
.verification(Verification::Signature);Implementations§
Source§impl AppcastSource
impl AppcastSource
Sourcepub fn new(url: impl Into<String>) -> AppcastSource
pub fn new(url: impl Into<String>) -> AppcastSource
Create a source for the appcast at url, matching enclosures for the
platform this binary was built for.
Sourcepub fn http(self, http: HttpOptions) -> AppcastSource
pub fn http(self, http: HttpOptions) -> AppcastSource
Fetch the appcast with http’s extra headers and proxy.
Sourcepub fn os(self, os: &str) -> AppcastSource
pub fn os(self, os: &str) -> AppcastSource
Accept only enclosures whose sparkle:os equals os
(case-insensitive). An enclosure without sparkle:os counts as
macos, as in Sparkle.
By default the source matches the running platform: on macOS macos;
on Windows WinSparkle’s windows-x64 / windows-arm64 / windows-x86,
then windows, then enclosures without sparkle:os; on Linux
linux-x64 / linux-arm64, then linux. Writing sparkle:os on
every enclosure of a shared feed avoids any ambiguity.
Sourcepub fn channel(self, channel: impl Into<String>) -> AppcastSource
pub fn channel(self, channel: impl Into<String>) -> AppcastSource
Also offer items on the sparkle:channel named channel (exact match).
Items without a channel are always offered. Call repeatedly to allow
several channels.
Sourcepub fn version_field(self, field: AppcastVersion) -> AppcastSource
pub fn version_field(self, field: AppcastVersion) -> AppcastSource
Choose which field holds the version. Defaults to
AppcastVersion::ShortVersionString.
Sourcepub fn system_version(self, version: Version) -> AppcastSource
pub fn system_version(self, version: Version) -> AppcastSource
Compare sparkle:minimumSystemVersion / sparkle:maximumSystemVersion
against version instead of the detected OS version. Without this, the
check runs on macOS only (other systems’ versions are not comparable).
Trait Implementations§
Source§impl Clone for AppcastSource
impl Clone for AppcastSource
Source§fn clone(&self) -> AppcastSource
fn clone(&self) -> AppcastSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AppcastSource
impl Debug for AppcastSource
Source§impl UpdateSource for AppcastSource
impl UpdateSource for AppcastSource
Auto Trait Implementations§
impl Freeze for AppcastSource
impl RefUnwindSafe for AppcastSource
impl Send for AppcastSource
impl Sync for AppcastSource
impl Unpin for AppcastSource
impl UnsafeUnpin for AppcastSource
impl UnwindSafe for AppcastSource
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