pub struct ChangeHistory {
pub total: u64,
pub first: u64,
pub revisions: Vec<RevisionChanges>,
pub broken: Option<String>,
}Expand description
What a read with history shows of a record’s revisions
(GetContentInput::history):
each asked for, oldest first, replayed from the original. The server and
the seed runner build it the same way (Self::build)
Fields§
§total: u64How many revisions the record has
first: u64The index of the first one listed, from 0
revisions: Vec<RevisionChanges>The ones asked for that replayed, oldest first
broken: Option<String>Why the history stops short, when it does
Implementations§
Source§impl ChangeHistory
impl ChangeHistory
Sourcepub fn build(
original: &Value,
revisions: &[(GovernanceLogId, Revision)],
dated: impl Fn(&GovernanceLogId) -> Option<DateTime<Utc>>,
shown: impl Fn(&GovernanceLogId) -> bool,
history: History,
) -> Self
pub fn build( original: &Value, revisions: &[(GovernanceLogId, Revision)], dated: impl Fn(&GovernanceLogId) -> Option<DateTime<Utc>>, shown: impl Fn(&GovernanceLogId) -> bool, history: History, ) -> Self
The history of a record stored as original, revised by
revisions in chain order (dated by dated), history of them,
held to MAX_CHANGE_BYTES and MAX_HISTORY_BYTES
A revision shown (a reader holds its changes already, and is
pointed at them) costs the budget nothing
Sourcepub fn unreadable(total: usize, why: String) -> Self
pub fn unreadable(total: usize, why: String) -> Self
No history, for a reason: the revisions could not be read
Trait Implementations§
Source§impl Clone for ChangeHistory
impl Clone for ChangeHistory
Source§impl Debug for ChangeHistory
impl Debug for ChangeHistory
Source§impl Default for ChangeHistory
impl Default for ChangeHistory
Source§impl<'de> Deserialize<'de> for ChangeHistory
impl<'de> Deserialize<'de> for ChangeHistory
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
impl Eq for ChangeHistory
Source§impl PartialEq for ChangeHistory
impl PartialEq for ChangeHistory
Source§impl Serialize for ChangeHistory
impl Serialize for ChangeHistory
impl StructuralPartialEq for ChangeHistory
Auto Trait Implementations§
impl Freeze for ChangeHistory
impl RefUnwindSafe for ChangeHistory
impl Send for ChangeHistory
impl Sync for ChangeHistory
impl Unpin for ChangeHistory
impl UnsafeUnpin for ChangeHistory
impl UnwindSafe for ChangeHistory
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
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§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
Compare self to
key and return true if they are equal.