pub struct ToolSource { /* private fields */ }Expand description
Stable, bounded provenance for one frozen tool descriptor.
Implementations§
Source§impl ToolSource
impl ToolSource
Sourcepub fn new(
kind: ToolSourceKind,
source_id: impl Into<String>,
trust: ToolTrust,
descriptor_digest: impl Into<String>,
) -> Result<Self, ToolSourceError>
pub fn new( kind: ToolSourceKind, source_id: impl Into<String>, trust: ToolTrust, descriptor_digest: impl Into<String>, ) -> Result<Self, ToolSourceError>
Creates validated tool-source provenance.
§Errors
Returns an error unless the source ID is canonical lowercase ASCII and the descriptor digest is exactly one lowercase hexadecimal SHA-256.
Sourcepub fn native_product() -> Self
pub fn native_product() -> Self
Returns the stable default provenance used by native product tools.
Sourcepub fn is_native_product(&self) -> bool
pub fn is_native_product(&self) -> bool
Returns whether this is the stable legacy-compatible product source.
Sourcepub const fn kind(&self) -> ToolSourceKind
pub const fn kind(&self) -> ToolSourceKind
Returns the provider-neutral source category.
Sourcepub fn descriptor_digest(&self) -> &str
pub fn descriptor_digest(&self) -> &str
Returns the lowercase SHA-256 descriptor digest.
Trait Implementations§
Source§impl Clone for ToolSource
impl Clone for ToolSource
Source§fn clone(&self) -> ToolSource
fn clone(&self) -> ToolSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ToolSource
impl Debug for ToolSource
Source§impl<'de> Deserialize<'de> for ToolSource
impl<'de> Deserialize<'de> for ToolSource
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ToolSource
Source§impl Hash for ToolSource
impl Hash for ToolSource
Source§impl Ord for ToolSource
impl Ord for ToolSource
Source§fn cmp(&self, other: &ToolSource) -> Ordering
fn cmp(&self, other: &ToolSource) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ToolSource
impl PartialEq for ToolSource
Source§impl PartialOrd for ToolSource
impl PartialOrd for ToolSource
Source§impl Serialize for ToolSource
impl Serialize for ToolSource
impl StructuralPartialEq for ToolSource
Auto Trait Implementations§
impl Freeze for ToolSource
impl RefUnwindSafe for ToolSource
impl Send for ToolSource
impl Sync for ToolSource
impl Unpin for ToolSource
impl UnsafeUnpin for ToolSource
impl UnwindSafe for ToolSource
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