Event

Enum Event 

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

Source

pub const fn is_progress(&self) -> bool

Returns true if the event is Event::Progress.

Source

pub const fn is_messages(&self) -> bool

Returns true if the event is Event::Messages

Source

pub const fn as_progress(&self) -> Option<&Vec<(T, i64)>>

Returns progress data if the event is Event::Progress

Source

pub const fn as_messages(&self) -> Option<(&T, &Vec<D>)>

Returns message data if the event is Event::Messages

Source

pub fn into_progress(self) -> Result<Vec<(T, i64)>, Self>

Returns progress data if the event is Event::Progress

Source

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>
where Vec<(T, i64)>: Archive, T: Archive, Vec<D>: Archive,

Source§

type Archived = ArchivedEvent<T, D>

The archived representation of this type. Read more
Source§

type Resolver = EventResolver<T, D>

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
Source§

unsafe fn resolve( &self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
Source§

impl<T: Clone, D: Clone> Clone for Event<T, D>

Source§

fn clone(&self) -> Event<T, D>

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<T: Debug, D: Debug> Debug for Event<T, D>

Source§

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

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

impl<__D: Fallible + ?Sized, T, D> Deserialize<Event<T, D>, __D> for Archived<Event<T, D>>
where Vec<(T, i64)>: Archive, Archived<Vec<(T, i64)>>: Deserialize<Vec<(T, i64)>, __D>, T: Archive, Archived<T>: Deserialize<T, __D>, Vec<D>: Archive, Archived<Vec<D>>: Deserialize<Vec<D>, __D>,

Source§

fn deserialize(&self, deserializer: &mut __D) -> Result<Event<T, D>, __D::Error>

Deserializes using the given deserializer
Source§

impl<T, D> From<Event<T, D>> for Event<T, D>

Source§

fn from(event: TimelyEvent<T, D>) -> Self

Converts to this type from the input type.
Source§

impl<T, D> From<Event<T, D>> for Event<T, D>

Source§

fn from(val: Event<T, D>) -> Self

Converts to this type from the input type.
Source§

impl<T: Hash, D: Hash> Hash for Event<T, D>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: Ord, D: Ord> Ord for Event<T, D>

Source§

fn cmp(&self, other: &Event<T, D>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq, D: PartialEq> PartialEq for Event<T, D>

Source§

fn eq(&self, other: &Event<T, D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd, D: PartialOrd> PartialOrd for Event<T, D>

Source§

fn partial_cmp(&self, other: &Event<T, D>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<__S: Fallible + ?Sized, T, D> Serialize<__S> for Event<T, D>
where Vec<(T, i64)>: Serialize<__S>, T: Serialize<__S>, Vec<D>: Serialize<__S>,

Source§

fn serialize(&self, serializer: &mut __S) -> Result<Self::Resolver, __S::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
Source§

impl<T: Eq, D: Eq> Eq for Event<T, D>

Source§

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>

§

impl<T, D> Send for Event<T, D>
where T: Send, D: Send,

§

impl<T, D> Sync for Event<T, D>
where T: Sync, D: Sync,

§

impl<T, D> Unpin for Event<T, D>
where T: Unpin, D: Unpin,

§

impl<T, D> UnwindSafe for Event<T, D>
where T: UnwindSafe, D: 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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

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 T
where T: Archive,

Source§

type Archived = <T as Archive>::Archived

The archived counterpart of this type. Unlike Archive, it may be unsized. Read more
Source§

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, )

Creates the archived version of the metadata for this value at the given position and writes it to the given output. Read more
Source§

unsafe fn resolve_unsized( &self, from: usize, to: usize, resolver: Self::MetadataResolver, out: *mut RelPtr<Self::Archived, <isize as Archive>::Archived>, )

Resolves a relative pointer to this value with the given from and to and writes it to the given output. 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<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Hashable for T
where T: Hash,

Source§

type Output = u64

The type of the output value.
Source§

fn hashed(&self) -> u64

A well-distributed integer derived from the data.
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> LayoutRaw for T

Source§

fn layout_raw(_: *const T) -> Layout

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ProgressEventTimestamp for T
where T: Data + Debug + Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Upcasts this ProgressEventTimestamp to Any. Read more
Source§

fn type_name(&self) -> &'static str

Returns the name of the concrete type of this object. Read more
Source§

impl<T, S> SerializeUnsized<S> for T
where T: Serialize<S>, S: Serializer + ?Sized,

Source§

fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>

Writes the object and returns the position of the archived type.
Source§

fn serialize_metadata(&self, _: &mut S) -> Result<(), <S as Fallible>::Error>

Serializes the metadata for the given type.
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, 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> Data for T
where T: Clone + 'static,

Source§

impl<T> Data for T
where T: Data + Ord + Debug,