pub struct Subject {
pub name: String,
pub digest: DigestSet,
}Expand description
Subject of an in-toto statement
Represents an artifact (file, module, etc.) that the statement applies to.
Fields§
§name: StringName or identifier of the subject
digest: DigestSetCryptographic digests of the subject
Implementations§
Source§impl Subject
impl Subject
Sourcepub fn new(name: impl Into<String>, sha256: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, sha256: impl Into<String>) -> Self
Create a new subject with SHA256 digest
Sourcepub fn with_digests(name: impl Into<String>, digest: DigestSet) -> Self
pub fn with_digests(name: impl Into<String>, digest: DigestSet) -> Self
Create a subject with multiple digest algorithms
Sourcepub fn from_bytes(name: impl Into<String>, bytes: &[u8]) -> Self
pub fn from_bytes(name: impl Into<String>, bytes: &[u8]) -> Self
Create a subject from raw bytes (computes SHA256)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subject
impl<'de> Deserialize<'de> for Subject
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
Auto Trait Implementations§
impl Freeze for Subject
impl RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl UnwindSafe for Subject
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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