pub enum Event<T, D> {
Progress(Vec<(T, i64)>),
Messages(T, Vec<D>),
}Expand description
Data and progress events of a captured stream.
Variants§
Progress(Vec<(T, i64)>)
Progress received via push_external_progress
Messages(T, Vec<D>)
Messages received via the data stream
Implementations§
Source§impl<T, D> Event<T, D>
impl<T, D> Event<T, D>
Sourcepub const fn is_progress(&self) -> bool
pub const fn is_progress(&self) -> bool
Returns true if the event is Event::Progress.
Sourcepub const fn is_messages(&self) -> bool
pub const fn is_messages(&self) -> bool
Returns true if the event is Event::Messages
Sourcepub const fn as_progress(&self) -> Option<&Vec<(T, i64)>>
pub const fn as_progress(&self) -> Option<&Vec<(T, i64)>>
Returns progress data if the event is Event::Progress
Sourcepub const fn as_messages(&self) -> Option<(&T, &Vec<D>)>
pub const fn as_messages(&self) -> Option<(&T, &Vec<D>)>
Returns message data if the event is Event::Messages
Sourcepub fn into_progress(self) -> Result<Vec<(T, i64)>, Self>
pub fn into_progress(self) -> Result<Vec<(T, i64)>, Self>
Returns progress data if the event is Event::Progress
Sourcepub fn into_messages(self) -> Result<(T, Vec<D>), Self>
pub fn into_messages(self) -> Result<(T, Vec<D>), Self>
Returns message data if the event is Event::Messages
Trait Implementations§
Source§impl<T, D> Archive for Event<T, D>
impl<T, D> Archive for Event<T, D>
Source§impl<T, D> From<Event<T, D>> for Event<T, D>
impl<T, D> From<Event<T, D>> for Event<T, D>
Source§fn from(event: TimelyEvent<T, D>) -> Self
fn from(event: TimelyEvent<T, D>) -> Self
Converts to this type from the input type.
Source§impl<T: Ord, D: Ord> Ord for Event<T, D>
impl<T: Ord, D: Ord> Ord for Event<T, D>
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: PartialOrd, D: PartialOrd> PartialOrd for Event<T, D>
impl<T: PartialOrd, D: PartialOrd> PartialOrd for Event<T, D>
impl<T: Eq, D: Eq> Eq for Event<T, D>
impl<T, D> StructuralPartialEq for Event<T, D>
Auto Trait Implementations§
impl<T, D> Freeze for Event<T, D>where
T: Freeze,
impl<T, D> RefUnwindSafe for Event<T, D>where
T: RefUnwindSafe,
D: RefUnwindSafe,
impl<T, D> Send for Event<T, D>
impl<T, D> Sync for Event<T, D>
impl<T, D> Unpin for Event<T, D>
impl<T, D> UnwindSafe for Event<T, D>where
T: UnwindSafe,
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be unsized. Read moreSource§type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
Source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
Creates the archived version of the metadata for this value at the given position and writes
it to the given output. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: *const T) -> Layout
fn layout_raw(_: *const T) -> Layout
Gets the layout of the type.