pub struct WithPrevious<T> {
pub previous: Option<T>,
pub current: T,
}Expand description
Represents a value paired with its previous value in the stream.
Used by CombineWithPreviousExt to provide
both current and previous values.
Fields§
§previous: Option<T>The previous value in the stream, if any
current: TThe current value in the stream
Implementations§
Source§impl<T> WithPrevious<T>
impl<T> WithPrevious<T>
Trait Implementations§
Source§impl<T: Clone> Clone for WithPrevious<T>
impl<T: Clone> Clone for WithPrevious<T>
Source§fn clone(&self) -> WithPrevious<T>
fn clone(&self) -> WithPrevious<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for WithPrevious<T>
impl<T: Debug> Debug for WithPrevious<T>
Source§impl<T: Timestamped> HasTimestamp for WithPrevious<T>
impl<T: Timestamped> HasTimestamp for WithPrevious<T>
Source§type Inner = <T as HasTimestamp>::Inner
type Inner = <T as HasTimestamp>::Inner
The type of the inner value wrapped by this timestamped type
Source§type Timestamp = <T as HasTimestamp>::Timestamp
type Timestamp = <T as HasTimestamp>::Timestamp
The type representing the timestamp
Source§impl<T: Ord> Ord for WithPrevious<T>
impl<T: Ord> Ord for WithPrevious<T>
Source§fn cmp(&self, other: &WithPrevious<T>) -> Ordering
fn cmp(&self, other: &WithPrevious<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for WithPrevious<T>
impl<T: PartialEq> PartialEq for WithPrevious<T>
Source§impl<T: PartialOrd> PartialOrd for WithPrevious<T>
impl<T: PartialOrd> PartialOrd for WithPrevious<T>
Source§impl<T: Timestamped> Timestamped for WithPrevious<T>
impl<T: Timestamped> Timestamped for WithPrevious<T>
Source§fn with_timestamp(value: Self::Inner, timestamp: Self::Timestamp) -> Self
fn with_timestamp(value: Self::Inner, timestamp: Self::Timestamp) -> Self
Creates a new instance wrapping the given value with the specified timestamp.
Source§fn with_fresh_timestamp(value: Self::Inner) -> Self
fn with_fresh_timestamp(value: Self::Inner) -> Self
Creates a new instance wrapping the given value with a fresh timestamp.
This is called by operators when emitting new values.
Each implementation determines how to generate fresh timestamps
(e.g., Utc::now() for chrono, atomic counter for u64, etc.)
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Consumes self and returns the inner value.
For wrapper types like
Sequenced<T>, this extracts T.
For domain types where Inner = Self, this typically returns self.impl<T: Eq> Eq for WithPrevious<T>
impl<T> StructuralPartialEq for WithPrevious<T>
Auto Trait Implementations§
impl<T> Freeze for WithPrevious<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithPrevious<T>where
T: RefUnwindSafe,
impl<T> Send for WithPrevious<T>where
T: Send,
impl<T> Sync for WithPrevious<T>where
T: Sync,
impl<T> Unpin for WithPrevious<T>where
T: Unpin,
impl<T> UnwindSafe for WithPrevious<T>where
T: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more