[][src]Struct erdos::dataflow::stream::ReadStream

pub struct ReadStream<D: Data> { /* fields omitted */ }
[]

Allows reading from a stream and registering callbacks.

Passed as an argument to Operator::new and Operator::connect. Also used in the driver to construct a dataflow.

Implementations

impl<D: Data> ReadStream<D>[src][]

pub fn new() -> Self[src][]

Create a stream into which we can write data.

pub fn add_callback<F: 'static + Fn(&Timestamp, &D)>(&self, callback: F)[src][]

Add a callback to be invoked when the stream receives a message.

pub fn add_watermark_callback<F: 'static + Fn(&Timestamp)>(&self, callback: F)[src][]

Add a callback to be invoked after the stream received, and the operator processed all the messages with a timestamp.

pub fn add_state<S: State>(&self, state: S) -> StatefulReadStream<D, S>[src][]

Returns a new instance of the stream with an associated state.

This state is accessible by callbacks added to the StatefulReadStream.

pub fn get_id(&self) -> StreamId[src]

pub fn get_name(&self) -> String[src]

pub fn is_closed(&self) -> bool[src]

pub fn try_read(&self) -> Result<Message<D>, TryReadError>[src][]

Tries to read a message from a channel.

Returns an immutable reference, or None if no messages are available at the moment (i.e., non-blocking read).

pub fn read(&self) -> Result<Message<D>, ReadError>[src][]

Blocking read. Returns None if the stream doesn't have a receive endpoint.

Trait Implementations

impl<D: Clone + Data> Clone for ReadStream<D>[src][+]

impl<D: Default + Data> Default for ReadStream<D>[src][+]

impl<'_, D> From<&'_ IngestStream<D>> for ReadStream<D> where
    D: Data + Deserialize<'a>, 
[src][+]

impl<'_, D> From<&'_ LoopStream<D>> for ReadStream<D> where
    D: Data + Deserialize<'a>, 
[src][+]

impl<'_, D: Data> From<&'_ ReadStream<D>> for ReadStream<D>[src][+]

impl<'_, D: Data> From<&'_ ReadStream<D>> for Rc<RefCell<InternalReadStream<D>>>[src][+]

impl<'_, D: Data> From<&'_ WriteStream<D>> for ReadStream<D>[src][+]

impl<D: Data> From<Rc<RefCell<InternalReadStream<D>>>> for ReadStream<D>[src][+]

Auto Trait Implementations

impl<D> !RefUnwindSafe for ReadStream<D>

impl<D> !Send for ReadStream<D>

impl<D> !Sync for ReadStream<D>

impl<D> Unpin for ReadStream<D>

impl<D> !UnwindSafe for ReadStream<D>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src][+]

impl<T> Borrow<T> for T where
    T: ?Sized
[src][+]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src][+]

impl<T> From<T> for T[src][+]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src][+]

impl<T> State for T where
    T: 'static + Clone
[src]

impl<T> ToOwned for T where
    T: Clone
[src][+]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src][+]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src][+]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.