pub struct PackageRow<'a> { /* private fields */ }Expand description
The fields a package list row shows, read from the index on demand.
Borrows the index and builds nothing up front, so making one per visible row is free.
Implementations§
Source§impl<'a> PackageRow<'a>
impl<'a> PackageRow<'a>
Sourcepub fn new(index: &'a PackageIndex, idx: usize) -> Option<Self>
pub fn new(index: &'a PackageIndex, idx: usize) -> Option<Self>
The row for the package at idx, or None if idx is out of range.
Sourcepub fn description(&self) -> Option<&'a str>
pub fn description(&self) -> Option<&'a str>
The latest version’s description.
Sourcepub fn version_number(&self) -> Option<&'a str>
pub fn version_number(&self) -> Option<&'a str>
The latest version’s number, such as 1.2.0.
Sourcepub fn categories(&self) -> impl Iterator<Item = &'a str> + use<'a>
pub fn categories(&self) -> impl Iterator<Item = &'a str> + use<'a>
The package’s categories, in index order.
Sourcepub fn date_updated(&self) -> OffsetDateTime
pub fn date_updated(&self) -> OffsetDateTime
When the package was last updated.
Sourcepub fn is_pinned(&self) -> bool
pub fn is_pinned(&self) -> bool
Whether the community pinned the package. Unset reads as false.
Sourcepub fn is_deprecated(&self) -> bool
pub fn is_deprecated(&self) -> bool
Whether the package is marked deprecated. Unset reads as false.
Trait Implementations§
Source§impl<'a> Clone for PackageRow<'a>
impl<'a> Clone for PackageRow<'a>
impl<'a> Copy for PackageRow<'a>
Auto Trait Implementations§
impl<'a> Forget for PackageRow<'a>
impl<'a> Freeze for PackageRow<'a>
impl<'a> Move for PackageRow<'a>
impl<'a> RefUnwindSafe for PackageRow<'a>
impl<'a> Send for PackageRow<'a>
impl<'a> Sync for PackageRow<'a>
impl<'a> Unpin for PackageRow<'a>
impl<'a> UnsafeUnpin for PackageRow<'a>
impl<'a> UnwindSafe for PackageRow<'a>
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