Snapshot

Struct Snapshot 

Source
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>

Source

pub fn name(&self) -> &str

Returns the Identity’s name at the time of this snapshot.

Source

pub fn email(&self) -> Option<&str>

Returns the Identity’s email at the time of this snapshot.

Source

pub fn login_name(&self) -> Option<&str>

Returns the Identity’s login name at the time of this snapshot.

Source

pub fn avatar_url(&self) -> Option<&Url>

Returns the Identity’s avatar url at the time of this snapshot.

Source

pub fn metadata(&self) -> Option<impl Iterator<Item = &(String, String)>>

Returns the Identity’s meta data at the time of this snapshot.

The iterator returns key value pairs.

Source§

impl Snapshot<Issue>

Source

pub fn body(&self) -> &str

Returns the Body of the Issue at the time of this snapshot.

Source

pub fn comments(&self) -> Vec<Comment>

Returns the Comments at the time of this snapshot.

Source

pub fn labels(&self) -> HashSet<&Label>

Returns the active Label at the time of this snapshot.

Source

pub fn status(&self) -> Status

Returns the active Status at the time of this snapshot.

Source

pub fn title(&self) -> &str

Returns the Issue’s title at the time of this snapshot.

Source

pub fn author(&self) -> IdentityStub

Return the author of this Issue

This is the same as the author of the Issue, which was used to create this snapshot.

Source

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>

Source

pub fn timeline(&self) -> &E::Timeline

Return the Timeline that contains all the changes to the Entity at the time of this snapshot.

Source

pub fn id(&self) -> EntityId<E>

Get the EntityId of this Snapshot.

This is the same as the EntityId of the Entity, which was used to create this snapshot.

Source

pub fn apply(&mut self, op: &Operation<E>)

Apply another operation to this Snapshot.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<E: Entity> Clone for Snapshot<E>
where E::Timeline: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Debug + Entity> Debug for Snapshot<E>
where E::Timeline: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Snapshot<Identity>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Queryable for Snapshot<Issue>

Source§

type KeyValue = MatchKeyValue

The type defining the possible keys a user can input.
Source§

fn matches(&self, key: &Self::KeyValue) -> bool

Check whether the key value pair is a match for this Queryable object.

Auto Trait Implementations§

§

impl<E> Freeze for Snapshot<E>
where <E as Entity>::Timeline: Freeze,

§

impl<E> RefUnwindSafe for Snapshot<E>

§

impl<E> Send for Snapshot<E>
where <E as Entity>::Timeline: Send, E: Send,

§

impl<E> Sync for Snapshot<E>
where <E as Entity>::Timeline: Sync, E: Sync,

§

impl<E> Unpin for Snapshot<E>
where <E as Entity>::Timeline: Unpin, E: Unpin,

§

impl<E> UnwindSafe for Snapshot<E>
where <E as Entity>::Timeline: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,