pub enum PackRef {
Local(PathBuf),
Bundled(String),
Registry {
name: String,
version: String,
pinned_digest: Option<String>,
},
Byos(String),
}Expand description
A parsed pack reference.
Variants§
Local(PathBuf)
Local file path (relative or absolute).
Bundled(String)
Bundled pack (name only, no version).
Registry
Registry pack with version.
Byos(String)
BYOS (Bring Your Own Storage) URL.
Implementations§
Source§impl PackRef
impl PackRef
Sourcepub fn parse(reference: &str) -> RegistryResult<Self>
pub fn parse(reference: &str) -> RegistryResult<Self>
Parse a pack reference string.
§Examples
use assay_registry::PackRef;
// Local file
let local = PackRef::parse("./custom.yaml").unwrap();
assert!(matches!(local, PackRef::Local(_)));
// Bundled pack
let bundled = PackRef::parse("eu-ai-act-baseline").unwrap();
assert!(matches!(bundled, PackRef::Bundled(_)));
// Registry pack with version
let registry = PackRef::parse("eu-ai-act-pro@1.2.0").unwrap();
assert!(matches!(registry, PackRef::Registry { .. }));
// Registry pack with pinned digest
let pinned = PackRef::parse("eu-ai-act-pro@1.2.0#sha256:abc123").unwrap();
if let PackRef::Registry { pinned_digest, .. } = pinned {
assert!(pinned_digest.is_some());
}
// BYOS
let byos = PackRef::parse("s3://bucket/pack.yaml").unwrap();
assert!(matches!(byos, PackRef::Byos(_)));Sourcepub fn is_bundled(&self) -> bool
pub fn is_bundled(&self) -> bool
Check if this is a bundled pack reference.
Sourcepub fn is_registry(&self) -> bool
pub fn is_registry(&self) -> bool
Check if this is a registry pack reference.
Sourcepub fn pinned_digest(&self) -> Option<&str>
pub fn pinned_digest(&self) -> Option<&str>
Get the pinned digest (for registry refs).
Trait Implementations§
impl Eq for PackRef
impl StructuralPartialEq for PackRef
Auto Trait Implementations§
impl Freeze for PackRef
impl RefUnwindSafe for PackRef
impl Send for PackRef
impl Sync for PackRef
impl Unpin for PackRef
impl UnsafeUnpin for PackRef
impl UnwindSafe for PackRef
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.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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.