pub struct UpdateConfigBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> UpdateConfigBuilder<S>
impl<S: State> UpdateConfigBuilder<S>
Sourcepub fn build_async(self) -> AsyncUpdateCheckerwhere
S: IsComplete,
Available on crate feature async only.
pub fn build_async(self) -> AsyncUpdateCheckerwhere
S: IsComplete,
async only.Build the configuration and return an AsyncUpdateChecker.
This is a convenience method that combines UpdateConfigBuilder::build
with AsyncUpdateChecker::new.
nyquest_preset::register();
futures::executor::block_on(async {
let checker = ib_update::github::UpdateConfig::builder()
.owner("owner")
.repo("repo")
.current_version("1.0.0")
.build_async();
let info = checker.check().await?;
println!("Latest: {}, update available: {}", info.latest().tag, info.has_update());
Ok(())
})Source§impl<S: State> UpdateConfigBuilder<S>
impl<S: State> UpdateConfigBuilder<S>
Sourcepub fn build_blocking(self) -> UpdateCheckerwhere
S: IsComplete,
Available on crate feature blocking only.
pub fn build_blocking(self) -> UpdateCheckerwhere
S: IsComplete,
blocking only.Build the configuration and return an UpdateChecker.
This is a convenience method that combines UpdateConfigBuilder::build
with UpdateChecker::new.
nyquest_preset::register();
let checker = ib_update::github::UpdateConfig::builder()
.owner("owner")
.repo("repo")
.current_version("1.0.0")
.build_blocking();
let info = checker.check()?;
println!("Latest: {}, update available: {}", info.latest().tag, info.has_update());Source§impl<S: State> UpdateConfigBuilder<S>
impl<S: State> UpdateConfigBuilder<S>
Sourcepub fn build(self) -> UpdateConfigwhere
S: IsComplete,
pub fn build(self) -> UpdateConfigwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn owner(self, value: impl Into<String>) -> UpdateConfigBuilder<SetOwner<S>>where
S::Owner: IsUnset,
pub fn owner(self, value: impl Into<String>) -> UpdateConfigBuilder<SetOwner<S>>where
S::Owner: IsUnset,
Required.
GitHub repository owner (e.g. "rust-lang").
Sourcepub fn repo(self, value: impl Into<String>) -> UpdateConfigBuilder<SetRepo<S>>where
S::Repo: IsUnset,
pub fn repo(self, value: impl Into<String>) -> UpdateConfigBuilder<SetRepo<S>>where
S::Repo: IsUnset,
Required.
GitHub repository name (e.g. "rust").
Sourcepub fn current_version(
self,
value: impl Into<String>,
) -> UpdateConfigBuilder<SetCurrentVersion<S>>where
S::CurrentVersion: IsUnset,
pub fn current_version(
self,
value: impl Into<String>,
) -> UpdateConfigBuilder<SetCurrentVersion<S>>where
S::CurrentVersion: IsUnset,
Sourcepub fn maybe_current_version(
self,
value: Option<impl Into<String>>,
) -> UpdateConfigBuilder<SetCurrentVersion<S>>where
S::CurrentVersion: IsUnset,
pub fn maybe_current_version(
self,
value: Option<impl Into<String>>,
) -> UpdateConfigBuilder<SetCurrentVersion<S>>where
S::CurrentVersion: IsUnset,
Sourcepub fn token(self, value: impl Into<String>) -> UpdateConfigBuilder<SetToken<S>>where
S::Token: IsUnset,
pub fn token(self, value: impl Into<String>) -> UpdateConfigBuilder<SetToken<S>>where
S::Token: IsUnset,
Sourcepub fn maybe_token(
self,
value: Option<impl Into<String>>,
) -> UpdateConfigBuilder<SetToken<S>>where
S::Token: IsUnset,
pub fn maybe_token(
self,
value: Option<impl Into<String>>,
) -> UpdateConfigBuilder<SetToken<S>>where
S::Token: IsUnset,
Sourcepub fn base_urls(
self,
value: Vec<String>,
) -> UpdateConfigBuilder<SetBaseUrls<S>>where
S::BaseUrls: IsUnset,
pub fn base_urls(
self,
value: Vec<String>,
) -> UpdateConfigBuilder<SetBaseUrls<S>>where
S::BaseUrls: IsUnset,
Sourcepub fn maybe_base_urls(
self,
value: Option<Vec<String>>,
) -> UpdateConfigBuilder<SetBaseUrls<S>>where
S::BaseUrls: IsUnset,
pub fn maybe_base_urls(
self,
value: Option<Vec<String>>,
) -> UpdateConfigBuilder<SetBaseUrls<S>>where
S::BaseUrls: IsUnset,
Sourcepub fn user_agent(
self,
value: impl Into<String>,
) -> UpdateConfigBuilder<SetUserAgent<S>>where
S::UserAgent: IsUnset,
pub fn user_agent(
self,
value: impl Into<String>,
) -> UpdateConfigBuilder<SetUserAgent<S>>where
S::UserAgent: IsUnset,
Sourcepub fn maybe_user_agent(
self,
value: Option<impl Into<String>>,
) -> UpdateConfigBuilder<SetUserAgent<S>>where
S::UserAgent: IsUnset,
pub fn maybe_user_agent(
self,
value: Option<impl Into<String>>,
) -> UpdateConfigBuilder<SetUserAgent<S>>where
S::UserAgent: IsUnset,
Source§impl<S: State> UpdateConfigBuilder<S>
impl<S: State> UpdateConfigBuilder<S>
pub fn base_url(self, url: String) -> UpdateConfigBuilder<SetBaseUrls<S>>where
S::BaseUrls: IsUnset,
Available on crate features
github-extra and multi-server only.pub fn maybe_base_url(
self,
url: Option<String>,
) -> UpdateConfigBuilder<SetBaseUrls<S>>where
S::BaseUrls: IsUnset,
Available on crate features
github-extra and multi-server only.Auto Trait Implementations§
impl<S> Freeze for UpdateConfigBuilder<S>
impl<S> RefUnwindSafe for UpdateConfigBuilder<S>
impl<S> Send for UpdateConfigBuilder<S>
impl<S> Sync for UpdateConfigBuilder<S>
impl<S> Unpin for UpdateConfigBuilder<S>
impl<S> UnsafeUnpin for UpdateConfigBuilder<S>
impl<S> UnwindSafe for UpdateConfigBuilder<S>
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