Struct rust_releases_core::ReleaseIndex
source · pub struct ReleaseIndex { /* private fields */ }Expand description
A release index is a data structure holding known Rust releases.
Ordering contract
Releases must be ordered from the newest to the oldest known release.
Implementations§
source§impl ReleaseIndex
impl ReleaseIndex
sourcepub fn from_source<S: Source>(source: S) -> Result<Self, <S as Source>::Error>
pub fn from_source<S: Source>(source: S) -> Result<Self, <S as Source>::Error>
Create a new ReleaseIndex from a given source.
Releases available in the index may vary based on the type of Source.
sourcepub fn most_recent(&self) -> Option<&Release>
pub fn most_recent(&self) -> Option<&Release>
Returns the most recent release.
Returns None if the index has not registered any release.
sourcepub fn least_recent(&self) -> Option<&Release>
pub fn least_recent(&self) -> Option<&Release>
Returns the least recent (oldest) registered release.
Returns None if the index has not registered any release.
Trait Implementations§
source§impl Debug for ReleaseIndex
impl Debug for ReleaseIndex
source§impl FromIterator<Release> for ReleaseIndex
impl FromIterator<Release> for ReleaseIndex
source§fn from_iter<T: IntoIterator<Item = Release>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Release>>(iter: T) -> Self
Create a new ReleaseIndex from a given iterable.
NB: Releases should already be sorted from the most recent to the least recent release.