pub struct FallbackSource { /* private fields */ }Expand description
Asks several sources in order and returns the release from the first one that answers: a mirror or a second host for when the primary is down.
The first source that answers wins, even when a later one knows a newer
release; the sources are not compared. When every source fails, the error
is the primary’s, and every failure is logged at warn.
Each source checks what it fetches with its own settings, such as a
manifest’s signing keys. The engine checks the artifact with the same
EngineConfig whichever source named it.
use gpui_updater_core::{FallbackSource, GitHubSource, StaticManifestSource};
let source = FallbackSource::new(StaticManifestSource::new(
"https://updates.example.com/latest.json",
))
.or(GitHubSource::new("owner", "repo"));Implementations§
Source§impl FallbackSource
impl FallbackSource
Sourcepub fn new(primary: impl UpdateSource) -> FallbackSource
pub fn new(primary: impl UpdateSource) -> FallbackSource
Ask primary first.
Sourcepub fn or(self, next: impl UpdateSource) -> FallbackSource
pub fn or(self, next: impl UpdateSource) -> FallbackSource
Ask next when every source before it has failed.
Trait Implementations§
Source§impl Debug for FallbackSource
impl Debug for FallbackSource
Source§impl UpdateSource for FallbackSource
impl UpdateSource for FallbackSource
Auto Trait Implementations§
impl !RefUnwindSafe for FallbackSource
impl !UnwindSafe for FallbackSource
impl Freeze for FallbackSource
impl Send for FallbackSource
impl Sync for FallbackSource
impl Unpin for FallbackSource
impl UnsafeUnpin for FallbackSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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