Struct libocc::Projector[][src]

pub struct Projector<T> where
    T: Clone + PartialEq
{ /* fields omitted */ }

Projects events from an event log

Manages several segments internally

Implementations

impl<T> Projector<T> where
    T: Clone + PartialEq
[src]

pub fn new() -> Projector<T>[src]

Generates a new projector for a given type

pub fn get_projection(&self) -> &Vec<T>[src]

Returns the current (cached) projection as a shared reference

pub fn project_at(&self, timestamp: &Timestamp) -> Option<Vec<T>>[src]

Performs a projection using a copy of the previous segments’ snapshot if available

pub fn push(&mut self, event: Event<T>) -> Result<()>[src]

Pushes an event onto the latest segment, updating the projection

pub fn make_snapshot(&mut self)[src]

Makes a new snapshot of the projector by creating a new segment

pub fn merge_at(&mut self, timestamp: &Timestamp) -> Result<()>[src]

Attempts to merge two segments/snapshots.
The one including the timestamp and the one before it (if any)

Trait Implementations

impl<T: Clone> Clone for Projector<T> where
    T: Clone + PartialEq
[src]

impl<T: Debug> Debug for Projector<T> where
    T: Clone + PartialEq
[src]

impl<'de, T> Deserialize<'de> for Projector<T> where
    T: Clone + PartialEq,
    T: Deserialize<'de>, 
[src]

impl<T> Serialize for Projector<T> where
    T: Clone + PartialEq,
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Projector<T> where
    T: RefUnwindSafe

impl<T> Send for Projector<T> where
    T: Send

impl<T> Sync for Projector<T> where
    T: Sync

impl<T> Unpin for Projector<T> where
    T: Unpin

impl<T> UnwindSafe for Projector<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.