pub struct TemplateProvenance {
pub template: String,
pub digest: Sha256Digest,
pub body_digest: Sha256Digest,
pub answers_digest: Sha256Digest,
}Expand description
What a task or a document created or regenerated from a template records under
TemplateProvenance::KEY.
An item created from a plain body records none.
Fields§
§template: StringThe template it was rendered from: the absolute path of a template file, or a loader
document’s reference verbatim. Recorded whole, whatever its length.
digest: Sha256DigestThe chain digest the content was rendered with.
body_digest: Sha256DigestThe SHA-256 of the item’s content exactly as written.
answers_digest: Sha256DigestThe SHA-256 of the resolved answers — defaults applied — as canonical JSON: keys sorted, no insignificant whitespace, UTF-8.
Implementations§
Source§impl TemplateProvenance
impl TemplateProvenance
Sourcepub const KEY: &'static str = MetadataKey::TEMPLATE_KEY
pub const KEY: &'static str = MetadataKey::TEMPLATE_KEY
The reserved metadata key this entry lives under: onetaskgraph.template.
Sourcepub fn of(
template: impl Into<String>,
rendered: &RenderedTemplate,
) -> Result<Self, TemplateError>
pub fn of( template: impl Into<String>, rendered: &RenderedTemplate, ) -> Result<Self, TemplateError>
The provenance of rendered, rendered from the template template names.
§Errors
TemplateError::Malformed when the rendering’s digest is not one — a
RenderedTemplate a caller assembled by hand rather than a render answered.
Trait Implementations§
Source§impl Clone for TemplateProvenance
impl Clone for TemplateProvenance
Source§impl Debug for TemplateProvenance
impl Debug for TemplateProvenance
Source§impl<'de> Deserialize<'de> for TemplateProvenance
impl<'de> Deserialize<'de> for TemplateProvenance
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>,
impl Eq for TemplateProvenance
Source§impl JsonSchema for TemplateProvenance
impl JsonSchema for TemplateProvenance
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for TemplateProvenance
impl PartialEq for TemplateProvenance
Source§impl Serialize for TemplateProvenance
impl Serialize for TemplateProvenance
impl StructuralPartialEq for TemplateProvenance
Auto Trait Implementations§
impl Freeze for TemplateProvenance
impl RefUnwindSafe for TemplateProvenance
impl Send for TemplateProvenance
impl Sync for TemplateProvenance
impl Unpin for TemplateProvenance
impl UnsafeUnpin for TemplateProvenance
impl UnwindSafe for TemplateProvenance
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.