pub struct IndexArtifact {
pub version: u8,
pub canonical_url: String,
pub final_url: String,
pub context: ArtifactContext,
pub stored_at_unix_secs: u64,
pub max_age_secs: u64,
pub capture: CaptureArtifact,
}Expand description
Versioned canonical runtime artifact for rendering without raw page HTML.
Fields§
§version: u8Artifact schema version.
canonical_url: StringCanonical key URL used for cache identity.
final_url: StringFinal URL observed during retrieval.
context: ArtifactContextCapture context describing how the artifact was produced.
stored_at_unix_secs: u64Unix timestamp when this artifact was stored.
max_age_secs: u64Max age used for stale-while-revalidate checks.
capture: CaptureArtifactEmbedded normalized capture artifact.
Implementations§
Source§impl IndexArtifact
impl IndexArtifact
Sourcepub fn from_document(
document: &IndexDocument,
canonical_url: &IndexUrl,
final_url: &IndexUrl,
context: ArtifactContext,
stored_at_unix_secs: u64,
max_age_secs: u64,
) -> Result<Self, CaptureError>
pub fn from_document( document: &IndexDocument, canonical_url: &IndexUrl, final_url: &IndexUrl, context: ArtifactContext, stored_at_unix_secs: u64, max_age_secs: u64, ) -> Result<Self, CaptureError>
Creates a canonical artifact from a semantic document.
Sourcepub fn freshness(&self, now_unix_secs: u64) -> ArtifactFreshness
pub fn freshness(&self, now_unix_secs: u64) -> ArtifactFreshness
Returns whether the artifact is fresh at now_unix_secs.
Sourcepub fn is_fresh(&self, now_unix_secs: u64) -> bool
pub fn is_fresh(&self, now_unix_secs: u64) -> bool
Returns whether the artifact is fresh at now_unix_secs.
Sourcepub fn from_text(input: &str) -> Result<Self, ArtifactStoreError>
pub fn from_text(input: &str) -> Result<Self, ArtifactStoreError>
Parses and validates an artifact.
Trait Implementations§
Source§impl Clone for IndexArtifact
impl Clone for IndexArtifact
Source§fn clone(&self) -> IndexArtifact
fn clone(&self) -> IndexArtifact
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 IndexArtifact
impl Debug for IndexArtifact
Source§impl PartialEq for IndexArtifact
impl PartialEq for IndexArtifact
Source§fn eq(&self, other: &IndexArtifact) -> bool
fn eq(&self, other: &IndexArtifact) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for IndexArtifact
impl StructuralPartialEq for IndexArtifact
Auto Trait Implementations§
impl Freeze for IndexArtifact
impl RefUnwindSafe for IndexArtifact
impl Send for IndexArtifact
impl Sync for IndexArtifact
impl Unpin for IndexArtifact
impl UnsafeUnpin for IndexArtifact
impl UnwindSafe for IndexArtifact
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