pub struct Snapshot<E: Entity> { /* private fields */ }Expand description
A compiled version of a Entity.
If you want to read/display this Entity, than this is
the type you want. If you need to change or create an
Entity, than use the functions on it directly.
An Snapshot<E> is, as the name implies, just a snapshot of the current
state of an Entity. As such, it is not intended to keep these snapshots
around for longer periods of time. Simply call
snapshot(), use the snapshot, and drop it again.
Implementations§
Source§impl Snapshot<Identity>
impl Snapshot<Identity>
Sourcepub fn login_name(&self) -> Option<&str>
pub fn login_name(&self) -> Option<&str>
Returns the Identity’s login name at the time of this snapshot.
Sourcepub fn avatar_url(&self) -> Option<&Url>
pub fn avatar_url(&self) -> Option<&Url>
Returns the Identity’s avatar url at the time of this snapshot.
Source§impl Snapshot<Issue>
impl Snapshot<Issue>
Sourcepub fn participants(&self) -> impl Iterator<Item = IdentityStub> + use<'_>
pub fn participants(&self) -> impl Iterator<Item = IdentityStub> + use<'_>
Get an iterator over all the people that actively participated on this issue.
Source§impl<E: Entity> Snapshot<E>
impl<E: Entity> Snapshot<E>
Sourcepub fn actors<'a>(&'a self) -> impl Iterator<Item = IdentityStub> + use<'a, E>where
<E as Entity>::HistoryStep: 'a,
pub fn actors<'a>(&'a self) -> impl Iterator<Item = IdentityStub> + use<'a, E>where
<E as Entity>::HistoryStep: 'a,
Get an iterator over all the people that acted in this Entity.
This means, that they are an author of one of the
HistorySteps that compose this timeline.
Sourcepub fn from_root_operation(op: &Operation<E>) -> Self
pub fn from_root_operation(op: &Operation<E>) -> Self
Construct this Snapshot from an Entity's root
operation.
This is probably not what you want, you should use Entity::snapshot
to get the snapshot of an Entity.