Skip to main content

OperatorBuilder

Struct OperatorBuilder 

Source
pub struct OperatorBuilder<'scope, T: Timestamp> { /* private fields */ }
Expand description

Builds operators with generic shape.

Implementations§

Source§

impl<'scope, T: Timestamp> OperatorBuilder<'scope, T>

Source

pub fn new(name: String, scope: Scope<'scope, T>) -> Self

Allocates a new generic operator builder from its containing scope.

Source

pub fn index(&self) -> usize

The operator’s scope-local index.

Source

pub fn global(&self) -> usize

The operator’s worker-unique identifier.

Source

pub fn shape(&self) -> &OperatorShape

Return a reference to the operator’s shape

Source

pub fn set_notify_for(&mut self, input: usize, notify: FrontierInterest)

Sets frontier interest for a specific input.

Source

pub fn new_input<C: Container, P>( &mut self, stream: Stream<'scope, T, C>, pact: P, ) -> P::Puller
where P: ParallelizationContract<T, C>,

Adds a new input to a generic operator builder, returning the Pull implementor to use.

Source

pub fn new_input_connection<C: Container, P, I>( &mut self, stream: Stream<'scope, T, C>, pact: P, connection: I, ) -> P::Puller
where P: ParallelizationContract<T, C>, I: IntoIterator<Item = (usize, Antichain<<T as Timestamp>::Summary>)>,

Adds a new input to a generic operator builder, returning the Pull implementor to use.

Source

pub fn new_output<C: Container>(&mut self) -> (Tee<T, C>, Stream<'scope, T, C>)

Adds a new output to a generic operator builder, returning the Push implementor to use.

Source

pub fn new_output_connection<C: Container, I>( &mut self, connection: I, ) -> (Tee<T, C>, Stream<'scope, T, C>)
where I: IntoIterator<Item = (usize, Antichain<<T as Timestamp>::Summary>)>,

Adds a new output to a generic operator builder, returning the Push implementor to use.

Source

pub fn build<L>(self, logic: L)
where L: FnMut(&mut SharedProgress<T>) -> bool + 'static,

Creates an operator implementation from supplied logic constructor.

Boxes the closure to avoid per-closure monomorphization based on L. For the fully generic (non-boxing) path, see [build_typed].

Source

pub fn build_boxed(self, logic: Box<dyn FnMut(&mut SharedProgress<T>) -> bool>)

Creates an operator implementation from pre-boxed logic.

This method exists primarily to force the Box<dyn ...> coercion, which can otherwise easily be Box<L> for specialized L instead.

Source

pub fn build_typed<L>(self, logic: L)
where L: FnMut(&mut SharedProgress<T>) -> bool + 'static,

Like build_reschedule, but specialized to the closure type L.

This method is instantiated once per distinct L, and one should be mindful of monomorphization bloat. Callers with many distinct closures should consider erasing their variation, for example via Box<dyn ...>, as demonstrated in [build].

Source

pub fn operator_info(&self) -> OperatorInfo

Information describing the operator.

Trait Implementations§

Source§

impl<'scope, T: Debug + Timestamp> Debug for OperatorBuilder<'scope, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'scope, T> Freeze for OperatorBuilder<'scope, T>

§

impl<'scope, T> !RefUnwindSafe for OperatorBuilder<'scope, T>

§

impl<'scope, T> !Send for OperatorBuilder<'scope, T>

§

impl<'scope, T> !Sync for OperatorBuilder<'scope, T>

§

impl<'scope, T> Unpin for OperatorBuilder<'scope, T>

§

impl<'scope, T> UnsafeUnpin for OperatorBuilder<'scope, T>

§

impl<'scope, T> !UnwindSafe for OperatorBuilder<'scope, 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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.