pub struct Records { /* private fields */ }
Implementations§
Source§impl Records
impl Records
pub fn load_from_path(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn load() -> Result<Self, Error>
pub fn get(&self, value: impl AsRef<str>) -> Option<&CrateInfo>
pub fn contains(&self, value: impl AsRef<str>) -> bool
Sourcepub fn insert(&mut self, value: CrateInfo) -> bool
pub fn insert(&mut self, value: CrateInfo) -> bool
Adds a value to the set. If the set did not have an equal element present, true is returned. If the set did have an equal element present, false is returned, and the entry is not updated.
Sourcepub fn replace(&mut self, value: CrateInfo) -> Option<CrateInfo>
pub fn replace(&mut self, value: CrateInfo) -> Option<CrateInfo>
Return the previous CrateInfo
for the package if there is any.
pub fn remove(&mut self, value: impl AsRef<str>) -> bool
pub fn take(&mut self, value: impl AsRef<str>) -> Option<CrateInfo>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Records
impl RefUnwindSafe for Records
impl Send for Records
impl Sync for Records
impl Unpin for Records
impl UnwindSafe for Records
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