pub struct ArtifactMetadata {
pub name: String,
pub version: String,
pub target_triple: String,
pub platform: Platform,
}Expand description
Information extracted from an artifact filename
Fields§
§name: StringPlugin name (lowercase with hyphens/underscores)
version: StringPlugin version (semver with ‘v’ prefix)
target_triple: StringTarget triple (e.g., “x86_64-unknown-linux-gnu”)
platform: PlatformDetected platform
Implementations§
Source§impl ArtifactMetadata
impl ArtifactMetadata
Sourcepub fn parse(filename: &str) -> Result<Self>
pub fn parse(filename: &str) -> Result<Self>
Parse artifact filename to extract metadata
Expected format: <plugin-name>-v<version>-<target-triple>.tar.gz
§Examples
use plugin_packager::platform::{ArtifactMetadata, Platform};
let meta = ArtifactMetadata::parse("myplugin-v1.0.0-x86_64-unknown-linux-gnu.tar.gz").unwrap();
assert_eq!(meta.name, "myplugin");
assert_eq!(meta.version, "1.0.0");
assert_eq!(meta.target_triple, "x86_64-unknown-linux-gnu");
assert_eq!(meta.platform, Platform::Linux);Sourcepub fn to_filename(&self) -> String
pub fn to_filename(&self) -> String
Generate artifact filename from metadata
Trait Implementations§
Source§impl Clone for ArtifactMetadata
impl Clone for ArtifactMetadata
Source§fn clone(&self) -> ArtifactMetadata
fn clone(&self) -> ArtifactMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ArtifactMetadata
impl Debug for ArtifactMetadata
Source§impl PartialEq for ArtifactMetadata
impl PartialEq for ArtifactMetadata
impl Eq for ArtifactMetadata
impl StructuralPartialEq for ArtifactMetadata
Auto Trait Implementations§
impl Freeze for ArtifactMetadata
impl RefUnwindSafe for ArtifactMetadata
impl Send for ArtifactMetadata
impl Sync for ArtifactMetadata
impl Unpin for ArtifactMetadata
impl UnsafeUnpin for ArtifactMetadata
impl UnwindSafe for ArtifactMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.