pub struct Addon {
pub primary_folder_id: String,
pub folders: Vec<AddonFolder>,
pub state: AddonState,
pub release_channel: ReleaseChannel,
/* private fields */
}Expand description
Struct which stores information about a single Addon. This struct is enriched
with metadata from the active repository for the addon. If there is no match
to any repository, metadata will be used from the primary AddonFolder for this
Addon.
Fields§
§primary_folder_id: StringId of the AddonFolder that will serve as a fallback for metadata if no
match to any Repository or if those fields don’t populate from the active repository
API. Also serves as the unique identifier for this Addon.
When we match against Curse which has modules for bundling multiple folders
into a single Addon, we use the first folder name alphabetically.
When matching against Tukui, we use the folder which has the Tukui project id
folders: Vec<AddonFolder>All AddonFolder’s provided by this Addon
state: AddonState§release_channel: ReleaseChannelImplementations§
Source§impl Addon
impl Addon
pub fn empty(primary_folder_id: &str) -> Self
pub fn set_repository(&mut self, repo_package: RepositoryPackage)
pub fn set_remote_package_from_repo_package( &mut self, repo_package: &RepositoryPackage, )
pub fn update_addon_folders(&mut self, folders: Vec<AddonFolder>)
pub fn repository(&self) -> Option<&RepositoryPackage>
Sourcepub fn repository_kind(&self) -> Option<RepositoryKind>
pub fn repository_kind(&self) -> Option<RepositoryKind>
Returns the repository kind linked to this addon
Sourcepub fn set_version(&mut self, version: String)
pub fn set_version(&mut self, version: String)
Sets the version of the addon
Sourcepub fn set_file_id(&mut self, file_id: i64)
pub fn set_file_id(&mut self, file_id: i64)
Sets the file id of the addon
Returns the author of the addon.
Sourcepub fn game_version(&self) -> Option<&str>
pub fn game_version(&self) -> Option<&str>
Returns the game version of the addon.
Sourcepub fn website_url(&self) -> Option<&str>
pub fn website_url(&self) -> Option<&str>
Returns the website url of the addon.
Sourcepub fn changelog_url(
&self,
default_release_channel: GlobalReleaseChannel,
) -> Option<String>
pub fn changelog_url( &self, default_release_channel: GlobalReleaseChannel, ) -> Option<String>
Returns the changelog url of the addon.
pub async fn changelog( &self, default_release_channel: GlobalReleaseChannel, ) -> Result<Changelog, RepositoryError>
pub fn remote_packages(&self) -> HashMap<ReleaseChannel, RemotePackage>
pub fn file_id(&self) -> Option<i64>
Sourcepub fn repository_id(&self) -> Option<&str>
pub fn repository_id(&self) -> Option<&str>
Returns the repository id for the active repository
Sourcepub fn is_ignored(&self, ignored: Option<&Vec<String>>) -> bool
pub fn is_ignored(&self, ignored: Option<&Vec<String>>) -> bool
Function returns a bool indicating if the user has manually ignored the addon.
Sourcepub fn is_updatable(&self, remote_package: &RemotePackage) -> bool
pub fn is_updatable(&self, remote_package: &RemotePackage) -> bool
Function returns a bool indicating if the remote_package is a update.
Sourcepub fn relevant_release_package(
&self,
default_release_channel: GlobalReleaseChannel,
) -> Option<RemotePackage>
pub fn relevant_release_package( &self, default_release_channel: GlobalReleaseChannel, ) -> Option<RemotePackage>
Returns the relevant release_package for the addon. Logic is that if a release channel above the selected is newer, we return that instead.
Trait Implementations§
Source§impl Ord for Addon
impl Ord for Addon
Source§impl PartialOrd for Addon
impl PartialOrd for Addon
Source§impl TryFrom<&Addon> for AddonCacheEntry
impl TryFrom<&Addon> for AddonCacheEntry
Source§type Error = CacheError
type Error = CacheError
impl Eq for Addon
Auto Trait Implementations§
impl Freeze for Addon
impl !RefUnwindSafe for Addon
impl Send for Addon
impl Sync for Addon
impl Unpin for Addon
impl !UnwindSafe for Addon
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> 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