pub struct EngineHistory {
pub initial_score: Score,
pub commands: Vec<Command>,
}Expand description
Serialisable snapshot of a ScoreEngine’s command history for crash recovery or replay.
initial_score is the state of the score before any commands were applied (i.e. the base
loaded via ScoreEngine::replace_score or the built-in default).
commands are the commands applied after that, in execution order.
Round-trip: ScoreEngine::from_history(engine.export_history()) produces an engine whose
score and version match the original.
Fields§
§initial_score: Score§commands: Vec<Command>Implementations§
Source§impl EngineHistory
impl EngineHistory
Sourcepub fn base_matches(&self, base: &Score) -> bool
pub fn base_matches(&self, base: &Score) -> bool
Return whether this history was recorded from the supplied collaboration base.
Sourcepub fn compare(&self, other: &Self) -> HistoryRelation
pub fn compare(&self, other: &Self) -> HistoryRelation
Compare two logs without applying commands or mutating either history.
Sourcepub fn conflict(&self, other: &Self) -> Option<HistoryConflict>
pub fn conflict(&self, other: &Self) -> Option<HistoryConflict>
Return explainable details when the two same-base logs diverge.
Trait Implementations§
Source§impl Clone for EngineHistory
impl Clone for EngineHistory
Source§impl Debug for EngineHistory
impl Debug for EngineHistory
Source§impl<'de> Deserialize<'de> for EngineHistory
impl<'de> Deserialize<'de> for EngineHistory
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 EngineHistory
impl RefUnwindSafe for EngineHistory
impl Send for EngineHistory
impl Sync for EngineHistory
impl Unpin for EngineHistory
impl UnsafeUnpin for EngineHistory
impl UnwindSafe for EngineHistory
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