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
sourceimpl 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
sourceimpl Debug for ReleaseIndex
impl Debug for ReleaseIndex
sourceimpl FromIterator<Release> for ReleaseIndex
impl FromIterator<Release> for ReleaseIndex
sourcefn 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.
Auto Trait Implementations
impl RefUnwindSafe for ReleaseIndex
impl Send for ReleaseIndex
impl Sync for ReleaseIndex
impl Unpin for ReleaseIndex
impl UnwindSafe for ReleaseIndex
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more