pub struct Manifest {
pub metadata: Metadata,
pub packages: Vec<Package>,
}Expand description
Top-level manifest structure for R2X plugin metadata
Fields§
§metadata: Metadata§packages: Vec<Package>Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn load() -> Result<Manifest, ManifestError>
pub fn load() -> Result<Manifest, ManifestError>
Load manifest from default location, returning empty manifest if file doesn’t exist
Sourcepub fn save(&self) -> Result<(), ManifestError>
pub fn save(&self) -> Result<(), ManifestError>
Save manifest to default location
Sourcepub fn clear(&mut self) -> Result<(), ManifestError>
pub fn clear(&mut self) -> Result<(), ManifestError>
Clear all packages and save
Sourcepub fn get_or_create_package(&mut self, name: &str) -> &mut Package
pub fn get_or_create_package(&mut self, name: &str) -> &mut Package
Find or create a package in the manifest
Sourcepub fn remove_package(&mut self, name: &str) -> bool
pub fn remove_package(&mut self, name: &str) -> bool
Remove a package from the manifest
Sourcepub fn remove_plugins_by_package(&mut self, package_name: &str) -> usize
pub fn remove_plugins_by_package(&mut self, package_name: &str) -> usize
Remove all plugins belonging to a package from the manifest
Sourcepub fn remove_decorator_registrations(&mut self, package_name: &str) -> bool
pub fn remove_decorator_registrations(&mut self, package_name: &str) -> bool
Remove decorator registrations for a package
Sourcepub fn list_plugins(&self) -> Vec<(String, String)>
pub fn list_plugins(&self) -> Vec<(String, String)>
List all plugins (compatibility method) - returns (plugin_name, package_name) tuples
Sourcepub fn list_all_plugins(&self) -> Vec<(String, String)>
pub fn list_all_plugins(&self) -> Vec<(String, String)>
List all plugins across all packages (compatibility helper)
Sourcepub fn total_plugin_count(&self) -> usize
pub fn total_plugin_count(&self) -> usize
Count total plugins across all packages
Sourcepub fn mark_explicit(&mut self, package_name: &str)
pub fn mark_explicit(&mut self, package_name: &str)
Mark a package as explicitly installed
Sourcepub fn mark_dependency(&mut self, package_name: &str, installed_by: &str)
pub fn mark_dependency(&mut self, package_name: &str, installed_by: &str)
Mark a package as a dependency of another package
Sourcepub fn add_dependency(&mut self, package_name: &str, dependency: &str)
pub fn add_dependency(&mut self, package_name: &str, dependency: &str)
Record that a package depends on another package
Sourcepub fn remove_package_with_deps(&mut self, package_name: &str) -> Vec<String>
pub fn remove_package_with_deps(&mut self, package_name: &str) -> Vec<String>
Remove a package and its dependencies if no other packages depend on them Returns list of packages removed
Sourcepub fn can_remove_package(&self, package_name: &str) -> bool
pub fn can_remove_package(&self, package_name: &str) -> bool
Check if a package can be safely removed (has no dependents)
Sourcepub fn get_dependents(&self, package_name: &str) -> Vec<String>
pub fn get_dependents(&self, package_name: &str) -> Vec<String>
Get all packages that depend on the given package
Sourcepub fn to_json_string(&self) -> String
pub fn to_json_string(&self) -> String
Serialize this Manifest to a JSON string
Sourcepub fn get_manifest_json() -> String
pub fn get_manifest_json() -> String
Return the manifest JSON for CLI/UI consumers
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Manifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Manifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Manifest
impl Serialize for Manifest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnwindSafe for Manifest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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