Skip to main content

StreamGraph

Struct StreamGraph 

Source
pub struct StreamGraph {
    pub chain_length: usize,
    pub max_inputs: usize,
    pub record_domain_size: u64,
    pub q1: Buffer<u64>,
    pub q2: Buffer<u64>,
    pub q3: Buffer<u64>,
    pub ingested: Counter,
    pub emitted: Counter,
}
Expand description

Bounded linear stream owner.

Fields§

§chain_length: usize

Number of stages in the linear chain.

§max_inputs: usize

Maximum records admitted at the source.

§record_domain_size: u64

Exclusive upper bound of record values.

§q1: Buffer<u64>

First FIFO edge owner.

§q2: Buffer<u64>

Second FIFO edge owner.

§q3: Buffer<u64>

Optional third FIFO edge owner.

§ingested: Counter

Source-admission counter.

§emitted: Counter

Sink-emission counter.

Implementations§

Source§

impl StreamGraph

Source

pub fn valid_config( chain_length: usize, capacity: usize, record_domain_size: u64, ) -> bool

Test whether a chain configuration is represented by this carrier.

Source

pub fn capacity(&self) -> usize

Capacity shared by every Buffer edge owner.

Source

pub fn new( chain_length: usize, capacity: usize, max_inputs: usize, record_domain_size: u64, ) -> StreamGraph

Construct an empty valid stream graph.

Source

pub fn source_ingest(&mut self, value: u64) -> bool

Admit one in-domain record when source and backpressure bounds permit it.

Source

pub fn middle2_fire(&mut self) -> bool

Transfer the oldest first-edge record to the second edge.

Source

pub fn middle3_fire(&mut self) -> bool

Transfer the oldest second-edge record through the optional fourth stage.

Source

pub fn sink_consume(&mut self) -> bool

Consume the oldest record from the final edge.

Source

pub fn done_stuttering(&mut self) -> bool

Execute the terminal stutter after bounded input is drained.

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.