Struct HistoryGroup
pub struct HistoryGroup {Show 16 fields
pub key: String,
pub name: Option<String>,
pub record_id: Option<String>,
pub named_by: Option<HistoryAuthor>,
pub open: bool,
pub start: usize,
pub end: usize,
pub children: Vec<HistoryGroup>,
pub depth: usize,
pub authors: Vec<HistoryAuthor>,
pub families: Vec<OpFamily>,
pub first_time: SystemTime,
pub last_time: SystemTime,
pub text_delta: Option<(usize, usize)>,
pub first_entry: HistoryEntryId,
pub last_entry: HistoryEntryId,
}Expand description
One collapsible band in a history surface.
start..end are indices into the entry slice the group was built from, in
the producer’s causal order. children are named sub-ranges; entries inside
start..end that no child covers are the group’s own rows.
Fields§
§key: StringDerived from the group’s first change, which does not move as the group grows, so expand/collapse survives a refresh.
name: Option<String>§record_id: Option<String>Record id of the naming, so a rename can address it.
named_by: Option<HistoryAuthor>§open: boolTrue while the range is still absorbing new changes.
start: usize§end: usize§children: Vec<HistoryGroup>At most MAX_GROUP_DEPTH deep in total.
depth: usize0 for a top-level group.
First-seen order.
families: Vec<OpFamily>First-seen order.
first_time: SystemTimeBoth are UNIX_EPOCH when no change in the range carried a clock.
last_time: SystemTime§text_delta: Option<(usize, usize)>None when at least one change in the range didn’t report a count —
a partial total would read as a complete one.
first_entry: HistoryEntryIdThe last one is the restore target: “restore to the end of this version”.
last_entry: HistoryEntryIdImplementations§
§impl HistoryGroup
impl HistoryGroup
pub fn is_empty(&self) -> bool
pub fn is_bare_change(&self) -> bool
pub fn is_bare_change(&self) -> bool
True when this band is a single unnamed change — the surfaces render those as a plain row rather than as a group with one thing in it.
pub fn title(&self, entries: &[HistoryEntry]) -> String
pub fn title(&self, entries: &[HistoryEntry]) -> String
The line a reader scans: the user’s name, or a derived description of what the range contains.
The derived form never claims more than it counted. It says how many changes and, when the range spans a minute or more, over how long.
pub fn subtitle(&self, entries: &[HistoryEntry]) -> String
pub fn subtitle(&self, entries: &[HistoryEntry]) -> String
The dim second line: who, and how much moved.
“Alice”, “Alice and Bob”, “Alice, Bob + 4”.
pub fn span_label(&self) -> Option<String>
pub fn span_label(&self) -> Option<String>
How long the range took, in the coarsest unit that is still true, or
None when it is under a minute or no change carried a clock.
pub fn direct_spans(&self) -> Vec<Range<usize>>
pub fn direct_spans(&self) -> Vec<Range<usize>>
Index ranges of this group’s own rows — everything in start..end that
no child covers. In ascending order.
pub fn walk<'a>(&'a self, out: &mut Vec<&'a HistoryGroup>)
pub fn walk<'a>(&'a self, out: &mut Vec<&'a HistoryGroup>)
Every group in this subtree, self first, then children. Used by the surfaces to flatten a forest into a row list.
Trait Implementations§
§impl Clone for HistoryGroup
impl Clone for HistoryGroup
§fn clone(&self) -> HistoryGroup
fn clone(&self) -> HistoryGroup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HistoryGroup
impl Debug for HistoryGroup
§impl PartialEq for HistoryGroup
impl PartialEq for HistoryGroup
impl StructuralPartialEq for HistoryGroup
Auto Trait Implementations§
impl Freeze for HistoryGroup
impl RefUnwindSafe for HistoryGroup
impl Send for HistoryGroup
impl Sync for HistoryGroup
impl Unpin for HistoryGroup
impl UnsafeUnpin for HistoryGroup
impl UnwindSafe for HistoryGroup
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more