pub trait Releaser: Clone {
type SemVersion: Into<Version>;
type DownloadLink: Into<Url>;
fn new<S: Into<String>>(name: S) -> Self;
fn fetch_latest_release(
&self
) -> Result<(Self::SemVersion, Self::DownloadLink)>;
fn latest_release(&self) -> Result<(Version, Url)> { ... }
}
Expand description
An interface for checking with remote servers to identify the latest release for an Alfred workflow.
This trait has been implemented for GithubReleaser
to check for a newer version of a workflow
that’s maintained on github.com
Required Associated Types
type SemVersion: Into<Version>
type SemVersion: Into<Version>
Typte that represents semantic compatible identifier of a release.
type DownloadLink: Into<Url>
type DownloadLink: Into<Url>
Type that represents a url to the latest release resource.
Required Methods
Creates a new Releaser
instance that is identified as name
fn fetch_latest_release(&self) -> Result<(Self::SemVersion, Self::DownloadLink)>
fn fetch_latest_release(&self) -> Result<(Self::SemVersion, Self::DownloadLink)>
Performs necessary communications to obtain release info in form of
SemVersion
and DownloadLink
types.
Returned tuple consists of semantic version compatible identifier of the release and a download link/url that can be used to fetch the release.
Implementors are strongly encouraged to get the meta-data about the latest release without performing a full download of the workflow.
Errors
Method returns Err(Error)
on file or network error.