pub enum OsvQueryName {
Confirmed(OsvPackageName),
Provisional(OsvPackageName),
}Expand description
The package name a ScanTarget is queried under, tagged with how far a negative answer
for it can be trusted.
OSV’s GitHub Actions names are exact-case, so a name that is not confirmed canonical may
simply be the wrong spelling: a hit on it is real (OSV matched that exact name), but an empty
result proves nothing. Carrying the distinction in the type — with no AsRef<str> and no
default — forces every producer to state it and every consumer to match on it.
Debug prints the variant and the redacted name.
§Examples
use deps_core::osv::{OsvPackageName, OsvQueryName};
let name = OsvPackageName::new("actions/checkout").unwrap();
assert_eq!(OsvQueryName::Confirmed(name.clone()).name(), &name);
assert_eq!(OsvQueryName::Provisional(name.clone()).name(), &name);Variants§
Confirmed(OsvPackageName)
The canonical name; both positive and negative results are authoritative.
Provisional(OsvPackageName)
The name as written in the manifest; only a positive result is authoritative, a clean result stays unchecked.
Implementations§
Source§impl OsvQueryName
impl OsvQueryName
Sourcepub const fn name(&self) -> &OsvPackageName
pub const fn name(&self) -> &OsvPackageName
The wrapped name, regardless of trust — for the wire, cache keys and advisory matching, where the result for an exact name is objective.
Trait Implementations§
Source§impl Clone for OsvQueryName
impl Clone for OsvQueryName
Source§impl Debug for OsvQueryName
impl Debug for OsvQueryName
impl Eq for OsvQueryName
Source§impl PartialEq for OsvQueryName
impl PartialEq for OsvQueryName
impl StructuralPartialEq for OsvQueryName
Auto Trait Implementations§
impl Freeze for OsvQueryName
impl RefUnwindSafe for OsvQueryName
impl Send for OsvQueryName
impl Sync for OsvQueryName
impl Unpin for OsvQueryName
impl UnsafeUnpin for OsvQueryName
impl UnwindSafe for OsvQueryName
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<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§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
key and return true if they are equal.