Let resumed SVG drafts precede a new final-state fingerprint
This commit is contained in:
1 parent
1a2379a6c2
commit
58b0f16998
9 files changed
+519
-84
No files matched your search
@@ -102,7 +102,8 @@ pub(crate) use registers::print_scaled;
|
||||
pub use registers::{Flex, Glue, Register, RegisterKind, RegisterValue};
|
||||
pub use rule::NativeRule;
|
||||
pub use session::{
|
||||
NativeSession, RevisionError, RevisionExecution, RevisionFailure, RevisionJob, SourceVersion,
|
||||
NativeSession, PreparedRevisionExecution, ResumedExecution, RevisionError, RevisionExecution,
|
||||
RevisionFailure, RevisionJob, SourceVersion,
|
||||
};
|
||||
pub use state::{CommandName, LinePenaltyKind, Macro, Meaning, Primitive, Profile, Replacement, State};
|
||||
|
||||
@@ -653,7 +654,7 @@ fn default_interaction_mode() -> u8 {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct Execution {
|
||||
pub struct Execution<F = u64> {
|
||||
#[serde(default)]
|
||||
pub format_dumped: bool,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
@@ -689,7 +690,7 @@ pub struct Execution {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
line_observations: Option<BTreeMap<usize, usize>>,
|
||||
pub incoming_state: u64,
|
||||
pub outgoing_state: u64,
|
||||
pub outgoing_state: F,
|
||||
pub steps: usize,
|
||||
/// Completed charge count for proving remaining box capacity at a splice.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -700,6 +701,55 @@ pub struct Execution {
|
||||
accounts_event_history: bool,
|
||||
}
|
||||
|
||||
/// The exact final state is available for layout. Its fingerprint may still
|
||||
/// require the canonical hash before a completed execution can be published.
|
||||
#[derive(Debug)]
|
||||
pub struct DeferredStateFingerprint(Option<u64>);
|
||||
|
||||
impl<F> Execution<F> {
|
||||
fn with_outgoing_state<T>(self, outgoing_state: T) -> Execution<T> {
|
||||
Execution {
|
||||
format_dumped: self.format_dumped,
|
||||
format_pdf_images: self.format_pdf_images,
|
||||
job_name: self.job_name,
|
||||
interaction_mode: self.interaction_mode,
|
||||
native_page: self.native_page,
|
||||
split_discards: self.split_discards,
|
||||
after_assignment: self.after_assignment,
|
||||
events: self.events,
|
||||
state: self.state,
|
||||
io: self.io,
|
||||
input_position: self.input_position,
|
||||
paragraph_mode: self.paragraph_mode,
|
||||
sources: self.sources,
|
||||
stream_sources: self.stream_sources,
|
||||
generated_inputs: self.generated_inputs,
|
||||
reads: self.reads,
|
||||
dependency_evidence: self.dependency_evidence,
|
||||
line_observations: self.line_observations,
|
||||
incoming_state: self.incoming_state,
|
||||
outgoing_state,
|
||||
steps: self.steps,
|
||||
box_nodes_created: self.box_nodes_created,
|
||||
reads_event_history: self.reads_event_history,
|
||||
accounts_event_history: self.accounts_event_history,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Execution<DeferredStateFingerprint> {
|
||||
fn needs_fingerprint(&self) -> bool {
|
||||
self.outgoing_state.0.is_none()
|
||||
}
|
||||
|
||||
fn finish_fingerprint(self, previous: Option<&Execution>) -> Execution {
|
||||
let fingerprint = self.outgoing_state.0.unwrap_or_else(|| {
|
||||
self.state.fingerprint_with_prior(previous.map(|prior| &prior.state))
|
||||
});
|
||||
self.with_outgoing_state(fingerprint)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub enum ScannerStatus {
|
||||
#[default]
|
||||
@@ -806,7 +856,7 @@ impl fmt::Display for Error {
|
||||
}
|
||||
impl std::error::Error for Error {}
|
||||
|
||||
impl Execution {
|
||||
impl<F> Execution<F> {
|
||||
/// Paint actual shipped boxes using their captured device state. No
|
||||
/// pagination or application of the job's final device settings.
|
||||
pub fn shipout_display_lists(&self) -> Result<Vec<crate::render::DisplayList>, Error> {
|
||||
|
||||
Reference in new issue
Block a user