pub struct MetadataManager<'a> { /* private fields */ }Implementations§
Source§impl<'a> MetadataManager<'a>
impl<'a> MetadataManager<'a>
pub fn new( package_storage: &'a mut PackageStorage, metadata_storage: &'a mut MetadataStorage, ) -> Self
Sourcepub fn pin_package(&mut self, name: &str, reason: Option<String>) -> Result<()>
pub fn pin_package(&mut self, name: &str, reason: Option<String>) -> Result<()>
Pins a package to its current version, preventing automatic updates.
Sourcepub fn unpin_package(&mut self, name: &str) -> Result<()>
pub fn unpin_package(&mut self, name: &str) -> Result<()>
Unpins a package, allowing it to receive automatic updates.
Sourcepub fn remove_package(&mut self, name: &str) -> Result<()>
pub fn remove_package(&mut self, name: &str) -> Result<()>
Removes package metadata for a package without touching runtime artifacts.
Sourcepub fn rename_package(&mut self, old_name: &str, new_name: &str) -> Result<bool>
pub fn rename_package(&mut self, old_name: &str, new_name: &str) -> Result<bool>
Renames a package alias without changing provider/repo/version metadata.
Sourcepub fn set_key(
&mut self,
name: &str,
set_key: &str,
) -> Result<MetadataSetResult>
pub fn set_key( &mut self, name: &str, set_key: &str, ) -> Result<MetadataSetResult>
Sets a package metadata field using dot-notation key path. Example: “is_pinned=true” or “pattern=.x86_64.”
Sourcepub fn get_key(&self, name: &str, get_key: &str) -> Result<String>
pub fn get_key(&self, name: &str, get_key: &str) -> Result<String>
Gets a package metadata field using dot-notation key path. Example: “is_pinned” or “version”
Sourcepub fn set_bulk(
&mut self,
name: &str,
set_keys: &[String],
) -> MetadataBulkSetResult
pub fn set_bulk( &mut self, name: &str, set_keys: &[String], ) -> MetadataBulkSetResult
Sets multiple package metadata fields in bulk.
Sourcepub fn get_bulk(&self, name: &str, get_keys: &[String]) -> MetadataBulkGetResult
pub fn get_bulk(&self, name: &str, get_keys: &[String]) -> MetadataBulkGetResult
Gets multiple package metadata fields in bulk.
Auto Trait Implementations§
impl<'a> !UnwindSafe for MetadataManager<'a>
impl<'a> Freeze for MetadataManager<'a>
impl<'a> RefUnwindSafe for MetadataManager<'a>
impl<'a> Send for MetadataManager<'a>
impl<'a> Sync for MetadataManager<'a>
impl<'a> Unpin for MetadataManager<'a>
impl<'a> UnsafeUnpin for MetadataManager<'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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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