pub struct ProvenanceSidecar {
pub source_bytes: Vec<u8>,
pub source_media_type: String,
pub licence: String,
pub vc: Vec<u8>,
pub semantic_metadata: Vec<u8>,
pub timestamp_epoch_s: u64,
pub version_hash: [u8; 32],
}Expand description
An owned provenance sidecar to bundle into a .10d — the source bytes an
asset was derived from, their media type, the licence (required), and an
optional verifiable credential.
Fields§
§source_bytes: Vec<u8>The immutable original bytes the asset was derived from.
source_media_type: StringThe source’s media type (e.g. model/gltf-binary, text/markdown).
licence: StringThe licence the source is available under (e.g. CC-BY-4.0, CC0).
Required — a provenance record with no licence is a stripped context.
vc: Vec<u8>An optional verifiable credential (CBOR / JWT bytes) attesting the derivation chain. Empty = none.
semantic_metadata: Vec<u8>Schema.org / Dublin Core semantic CBOR-LD metadata payload.
timestamp_epoch_s: u64Creation or harvest timestamp (UNIX epoch seconds).
version_hash: [u8; 32]Cryptographic version control hash (e.g., SHA256 of the git commit or asset).
Implementations§
Source§impl ProvenanceSidecar
impl ProvenanceSidecar
pub fn new( source_bytes: impl Into<Vec<u8>>, source_media_type: impl Into<String>, licence: impl Into<String>, ) -> Self
pub fn with_vc(self, vc: impl Into<Vec<u8>>) -> Self
pub fn with_metadata( self, metadata: impl Into<Vec<u8>>, timestamp: u64, hash: [u8; 32], ) -> Self
Sourcepub fn source_digest(&self) -> u32
pub fn source_digest(&self) -> u32
The CRC-32C digest of the source bytes — the value stored in the header
and re-checked by validate_provenance.
Trait Implementations§
Source§impl Clone for ProvenanceSidecar
impl Clone for ProvenanceSidecar
Source§fn clone(&self) -> ProvenanceSidecar
fn clone(&self) -> ProvenanceSidecar
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProvenanceSidecar
impl Debug for ProvenanceSidecar
Source§impl Default for ProvenanceSidecar
impl Default for ProvenanceSidecar
Source§fn default() -> ProvenanceSidecar
fn default() -> ProvenanceSidecar
Source§impl PartialEq for ProvenanceSidecar
impl PartialEq for ProvenanceSidecar
Source§fn eq(&self, other: &ProvenanceSidecar) -> bool
fn eq(&self, other: &ProvenanceSidecar) -> bool
self and other values to be equal, and is used by ==.impl Eq for ProvenanceSidecar
impl StructuralPartialEq for ProvenanceSidecar
Auto Trait Implementations§
impl Freeze for ProvenanceSidecar
impl RefUnwindSafe for ProvenanceSidecar
impl Send for ProvenanceSidecar
impl Sync for ProvenanceSidecar
impl Unpin for ProvenanceSidecar
impl UnsafeUnpin for ProvenanceSidecar
impl UnwindSafe for ProvenanceSidecar
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more