Struct libocc::Projector [−][src]
Projects events from an event log
Manages several segments internally
Implementations
impl<T> Projector<T> where
T: Clone + PartialEq,
[src]
T: Clone + PartialEq,
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]
T: Clone + PartialEq,
impl<T: Debug> Debug for Projector<T> where
T: Clone + PartialEq,
[src]
T: Clone + PartialEq,
impl<'de, T> Deserialize<'de> for Projector<T> where
T: Clone + PartialEq,
T: Deserialize<'de>,
[src]
T: Clone + PartialEq,
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T> Serialize for Projector<T> where
T: Clone + PartialEq,
T: Serialize,
[src]
T: Clone + PartialEq,
T: Serialize,
Auto Trait Implementations
impl<T> RefUnwindSafe for Projector<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Projector<T> where
T: Send,
T: Send,
impl<T> Sync for Projector<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Projector<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Projector<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,