Skip to main content

Stream

Struct Stream 

Source
pub struct Stream<I, T> { /* private fields */ }
Expand description

Stream.

Implementations§

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn audit<D>(&self, duration: D) -> Stream<I, T>
where D: IntoDuration,

Source

pub fn audit_with<F, D>(&self, f: F) -> Stream<I, T>
where F: SelectFn<I, T, D>, D: IntoDuration,

Source§

impl<I, T> Stream<I, Delta<I, T>>
where I: Id, T: Value + Clone + Eq,

Source

pub fn chunks(&self) -> Stream<I, Chunk<I, T>>

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn coalesce<S>(&self, streams: S) -> Stream<I, T>
where S: IntoStreamSet<I, T>,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone + Eq,

Source

pub fn count(&self, id: I) -> Stream<I, usize>

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn debounce<D>(&self, duration: D) -> Stream<I, T>
where D: IntoDuration,

Source

pub fn debounce_with<F, D>(&self, f: F) -> Stream<I, T>
where F: SelectFn<I, T, D>, D: IntoDuration,

Source§

impl<I, T> Stream<I, Delta<I, T>>
where I: Id, T: Value + Clone + Eq,

Source

pub fn delta_count(&self) -> Stream<I, usize>

Source§

impl<I, T> Stream<I, Delta<I, T>>
where I: Id, T: Value + Clone,

Source

pub fn delta_filter<F>(&self, f: F) -> Stream<I, Delta<I, T>>
where F: FilterFn<I, T> + Clone,

Source§

impl<I, T> Stream<I, Delta<I, T>>
where I: Id, T: Value + Clone,

Source

pub fn delta_filter_map<F, U>(&self, f: F) -> Stream<I, Delta<I, U>>
where F: FilterMapFn<I, T, U> + Clone, U: Value,

Source§

impl<I, T> Stream<I, Delta<I, T>>
where I: Id, T: Value + Clone,

Source

pub fn delta_map<F, U>(&self, f: F) -> Stream<I, Delta<I, U>>
where F: MapFn<I, T, U> + Clone, U: Value,

Source§

impl<I, T> Stream<I, Delta<I, T>>
where I: Id, T: Value + Clone + Eq,

Source

pub fn delta_reduce<F, U>(&self, f: F) -> Stream<I, U>
where F: SelectFn<I, dyn Collection<I, T>, Option<U>>, U: Value,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone + Eq,

Source

pub fn difference<S>(&self, streams: S) -> Stream<I, T>
where S: IntoStreamSet<I, T>,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn fill(&self, default: T) -> Stream<I, T>

Source

pub fn fill_with<F>(&self, f: F) -> Stream<I, T>
where F: DefaultFn<I, T> + Clone,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn filter<F>(&self, f: F) -> Stream<I, T>
where F: FilterFn<I, T> + Clone,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn filter_map<F, U>(&self, f: F) -> Stream<I, U>
where F: FilterMapFn<I, T, U> + Clone, U: Value,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn group<F, U>(&self, f: F) -> Stream<I, Delta<I, U>>
where F: SelectFn<I, T, I>, U: Value,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn inspect<F>(&self, f: F) -> Stream<I, T>
where F: InspectFn<I, T> + Clone,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone + Eq,

Source

pub fn intersection<S>(&self, streams: S) -> Stream<I, T>
where S: IntoStreamSet<I, T>,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value,

Source

pub fn join<S, O>(&self, streams: S) -> Stream<I, O::Item>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoin<I, All>,

Source

pub fn left_join<S, O>(&self, streams: S) -> Stream<I, O::Item>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoin<I, First>,

Source

pub fn full_join<S, O>(&self, streams: S) -> Stream<I, O::Item>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoin<I, Any>,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value,

Source

pub fn join_filter<S, O, F>(&self, streams: S, f: F) -> Stream<I, O::Item>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinFilter<I, All>, F: FilterFn<I, Splat<O::Item>> + Clone,

Source

pub fn left_join_filter<S, O, F>(&self, streams: S, f: F) -> Stream<I, O::Item>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinFilter<I, First>, F: FilterFn<I, Splat<O::Item>> + Clone,

Source

pub fn full_join_filter<S, O, F>(&self, streams: S, f: F) -> Stream<I, O::Item>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinFilter<I, Any>, F: FilterFn<I, Splat<O::Item>> + Clone,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value,

Source

pub fn join_filter_map<S, O, F, U>(&self, streams: S, f: F) -> Stream<I, U>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinFilterMap<I, All>, F: FilterMapFn<I, Splat<O::Item>, U> + Clone, U: Value,

Source

pub fn left_join_filter_map<S, O, F, U>(&self, streams: S, f: F) -> Stream<I, U>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinFilterMap<I, First>, F: FilterMapFn<I, Splat<O::Item>, U> + Clone, U: Value,

Source

pub fn full_join_filter_map<S, O, F, U>(&self, streams: S, f: F) -> Stream<I, U>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinFilterMap<I, Any>, F: FilterMapFn<I, Splat<O::Item>, U> + Clone, U: Value,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value,

Source

pub fn join_map<S, O, F, U>(&self, streams: S, f: F) -> Stream<I, U>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinMap<I, All>, F: MapFn<I, Splat<O::Item>, U> + Clone, U: Value,

Source

pub fn left_join_map<S, O, F, U>(&self, streams: S, f: F) -> Stream<I, U>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinMap<I, First>, F: MapFn<I, Splat<O::Item>, U> + Clone, U: Value,

Source

pub fn full_join_map<S, O, F, U>(&self, streams: S, f: F) -> Stream<I, U>
where S: IntoStreamTupleCons<I, T, Output = O>, O: IntoJoinMap<I, Any>, F: MapFn<I, Splat<O::Item>, U> + Clone, U: Value,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value,

Source

pub fn lift<F, U>(&self, f: F) -> Stream<I, Delta<I, U>>
where F: LiftFn<I, T, U>, U: Value + Clone + Eq,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn map<F, U>(&self, f: F) -> Stream<I, U>
where F: MapFn<I, T, U> + Clone, U: Value,

Source

pub fn map_concurrency<F, U>(&self, f: F, concurrency: usize) -> Stream<I, U>
where F: MapFn<I, T, U> + Clone, U: Value,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone + Eq,

Source

pub fn product<U>(&self, stream: &Stream<I, U>) -> Stream<I, Delta<I, (T, U)>>
where U: Value + Clone + Eq,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone + Eq,

Source

pub fn reduce<F, U>(&self, id: I, f: F) -> Stream<I, U>
where F: SelectFn<I, dyn Collection<I, T>, Option<U>>, U: Value,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn sample<D>(&self, duration: D) -> Stream<I, T>
where D: IntoDuration,

Source

pub fn sample_with<F, D>(&self, f: F) -> Stream<I, T>
where F: SelectFn<I, T, D>, D: IntoDuration,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn select( &self, selector: &Stream<I, Condition<I>>, ) -> Stream<I, Delta<I, T>>

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone + Ord,

Source

pub fn sort(&self) -> Stream<I, Position<T>>

Source

pub fn sort_with<F>(&self, f: F) -> Stream<I, Position<T>>
where F: Fn(&T, &T) -> Ordering + Clone + 'static,

Source

pub fn sort_by<F, K>(&self, f: F) -> Stream<I, Position<T>>
where F: Fn(&T) -> K + Clone + 'static, K: Ord,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn throttle<D>(&self, duration: D) -> Stream<I, T>
where D: IntoDuration,

Source

pub fn throttle_with<F, D>(&self, f: F) -> Stream<I, T>
where F: SelectFn<I, T, D>, D: IntoDuration,

Source§

impl<I, T> Stream<I, Delta<I, T>>
where I: Id, T: Value + Clone,

Source

pub fn transpose(&self) -> Stream<I, Delta<I, T>>

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone + Eq,

Source

pub fn union<S>(&self, streams: S) -> Stream<I, T>
where S: IntoStreamSet<I, T>,

Source§

impl<I, T> Stream<I, T>
where I: Id, T: Value + Clone,

Source

pub fn for_each<F>(&self, f: F)
where F: ForEachFn<I, T> + Clone,

Trait Implementations§

Source§

impl<I, T> Clone for Stream<I, T>

Source§

fn clone(&self) -> Self

Clones the stream.

1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I: Debug, T: Debug> Debug for Stream<I, T>

Source§

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

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

impl<I, T> FromIterator<Stream<I, T>> for StreamSet<I, T>

Source§

fn from_iter<S>(iter: S) -> Self
where S: IntoIterator<Item = Stream<I, T>>,

Creates a stream set from an iterator.

§Examples
use zrx_stream::combinator::{IntoStreamSet, StreamSet};
use zrx_stream::workspace::Workspace;

// Create workspace and workflow
let workspace = Workspace::<&str>::new();
let workflow = workspace.add_workflow();

// Create streams (homogeneous)
let a = workflow.add_source::<i32>();
let b = workflow.add_source::<i32>();

// Create stream set from iterator
let set = StreamSet::from_iter([a, b]);
Source§

impl<I, T> IntoStreamSet<I, T> for &Stream<I, T>

Source§

fn into_stream_set(self) -> StreamSet<I, T>

Converts a stream reference into a stream set.

Albeit this conversion is trivial, it allows to pass stream references to functions that expect sets, which can be quite convenient.

§Examples
use zrx_stream::combinator::IntoStreamSet;
use zrx_stream::workspace::Workspace;

// Create workspace and workflow
let workspace = Workspace::<&str>::new();
let workflow = workspace.add_workflow();

// Create stream
let stream = workflow.add_source::<i32>();

// Create stream set
let set = stream.into_stream_set();
Source§

impl<I, T> IntoStreamTuple<I> for &Stream<I, T>

Source§

fn into_stream_tuple(self) -> Self::Output

Converts a stream reference into a stream tuple.

Albeit this conversion is trivial, it allows to pass stream references to functions that expect tuples, which can be quite convenient.

§Examples
use zrx_stream::combinator::IntoStreamTuple;
use zrx_stream::workspace::Workspace;

// Create workspace and workflow
let workspace = Workspace::<&str>::new();
let workflow = workspace.add_workflow();

// Create stream
let stream = workflow.add_source::<i32>();

// Create stream tuple
let tuple = stream.into_stream_tuple();
Source§

type Output = (Stream<I, T>,)

Output type of conversion.
Source§

impl<I, T, U> OperatorExt<I, T, U> for Stream<I, T>
where I: Id, T: Value,

Source§

fn with_operator<O>(&self, operator: O) -> Stream<I, U>
where O: Operator<I, T> + 'static, U: Value,

Applies the given operator and returns a stream.

Source§

impl<I, T> PartialEq for Stream<I, T>

Source§

fn eq(&self, other: &Self) -> bool

Compares two streams for equality.

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<I, T> Eq for Stream<I, T>

Auto Trait Implementations§

§

impl<I, T> Freeze for Stream<I, T>

§

impl<I, T> !RefUnwindSafe for Stream<I, T>

§

impl<I, T> !Send for Stream<I, T>

§

impl<I, T> !Sync for Stream<I, T>

§

impl<I, T> Unpin for Stream<I, T>
where T: Unpin,

§

impl<I, T> UnsafeUnpin for Stream<I, T>

§

impl<I, T> !UnwindSafe for Stream<I, T>

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> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, E> IntoReport<T, E> for T
where E: Error,

Source§

fn into_report(self) -> Result<Report<T>, E>

Creates a report from a value T and wraps it in a result.

§Examples
use std::io::Error;
use zrx_diagnostic::report::IntoReport;

// Define function returning a value
fn f() -> impl IntoReport<i32, Error> {
    42
}

// Invoke function and create report
let res = f().into_report();
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> Value for T
where T: Debug + 'static,