pub struct OperatorBuilder<'scope, T: Timestamp> { /* private fields */ }Expand description
Builds operators with generic shape.
Implementations§
Source§impl<'scope, T: Timestamp> OperatorBuilder<'scope, T>
impl<'scope, T: Timestamp> OperatorBuilder<'scope, T>
Sourcepub fn new(name: String, scope: Scope<'scope, T>) -> Self
pub fn new(name: String, scope: Scope<'scope, T>) -> Self
Allocates a new generic operator builder from its containing scope.
Sourcepub fn set_notify_for(&mut self, input: usize, notify: FrontierInterest)
pub fn set_notify_for(&mut self, input: usize, notify: FrontierInterest)
Sets frontier interest for a specific input.
Sourcepub fn new_input<C: Container, P>(
&mut self,
stream: Stream<'scope, T, C>,
pact: P,
) -> InputHandleCore<T, C, P::Puller>where
P: ParallelizationContract<T, C>,
pub fn new_input<C: Container, P>(
&mut self,
stream: Stream<'scope, T, C>,
pact: P,
) -> InputHandleCore<T, C, P::Puller>where
P: ParallelizationContract<T, C>,
Adds a new input to a generic operator builder, returning the Pull implementor to use.
Sourcepub fn new_input_connection<C: Container, P, I>(
&mut self,
stream: Stream<'scope, T, C>,
pact: P,
connection: I,
) -> InputHandleCore<T, C, P::Puller>where
P: ParallelizationContract<T, C>,
I: IntoIterator<Item = (usize, Antichain<<T as Timestamp>::Summary>)> + Clone,
pub fn new_input_connection<C: Container, P, I>(
&mut self,
stream: Stream<'scope, T, C>,
pact: P,
connection: I,
) -> InputHandleCore<T, C, P::Puller>where
P: ParallelizationContract<T, C>,
I: IntoIterator<Item = (usize, Antichain<<T as Timestamp>::Summary>)> + Clone,
Adds a new input with connection information to a generic operator builder, returning the Pull implementor to use.
The connection parameter contains promises made by the operator for each of the existing outputs, that any timestamp
appearing at the input, any output timestamp will be greater than or equal to the input timestamp subjected to a Summary
greater or equal to some element of the corresponding antichain in connection.
Commonly the connections are either the unit summary, indicating the same timestamp might be produced as output, or an empty antichain indicating that there is no connection from the input to the output.
Sourcepub fn new_output<C: Container>(
&mut self,
) -> (Output<T, C>, Stream<'scope, T, C>)
pub fn new_output<C: Container>( &mut self, ) -> (Output<T, C>, Stream<'scope, T, C>)
Adds a new output to a generic operator builder, returning the Push implementor to use.
Sourcepub fn new_output_connection<C: Container, I>(
&mut self,
connection: I,
) -> (Output<T, C>, Stream<'scope, T, C>)
pub fn new_output_connection<C: Container, I>( &mut self, connection: I, ) -> (Output<T, C>, Stream<'scope, T, C>)
Adds a new output with connection information to a generic operator builder, returning the Push implementor to use.
The connection parameter contains promises made by the operator for each of the existing inputs, that any timestamp
appearing at the input, any output timestamp will be greater than or equal to the input timestamp subjected to a Summary
greater or equal to some element of the corresponding antichain in connection.
Commonly the connections are either the unit summary, indicating the same timestamp might be produced as output, or an empty antichain indicating that there is no connection from the input to the output.
Sourcepub fn build<B, L>(self, constructor: B)
pub fn build<B, L>(self, constructor: B)
Creates an operator implementation from supplied logic constructor.
Sourcepub fn build_reschedule<B, L>(self, constructor: B)
pub fn build_reschedule<B, L>(self, constructor: B)
Creates an operator implementation from supplied logic constructor.
Unlike build, the supplied closure can indicate if the operator
should be considered incomplete. A not-incomplete operator will be
shut down if it has empty input frontiers and holds no capabilities.
Flagging oneself as incomplete is most commonly used by operators
that manage external resources like file writes or transactions that
must complete before the operator should be shut down.
This method boxes B and L and delegates to [build_reschedule_boxed].
For the fully generic (non-boxing) path, see [build_reschedule_typed].
Sourcepub fn build_reschedule_boxed<'a>(
self,
constructor: Box<dyn FnOnce(Vec<Capability<T>>) -> Box<dyn FnMut(&[MutableAntichain<T>]) -> bool> + 'a>,
)
pub fn build_reschedule_boxed<'a>( self, constructor: Box<dyn FnOnce(Vec<Capability<T>>) -> Box<dyn FnMut(&[MutableAntichain<T>]) -> bool> + 'a>, )
Like build_reschedule, but with a pre-boxed constructor.
This method exists primarily to force the Box<dyn ...> coercions, which
can otherwise easily be Box<B> or Box<L> for specialized B and L instead.
Sourcepub fn build_reschedule_typed<B, L>(self, constructor: B)
pub fn build_reschedule_typed<B, L>(self, constructor: B)
Like build_reschedule, but specialized to the closure types B and L.
This method is instantiated once per distinct (B, L) pair, and one
should be mindful of monomorphization bloat. Callers with many closures
should consider erasing their variation, for example via Box<dyn ...>.
This method calls build_typed directly using a new closure, mirroring
the variation in L, rather than forcing it to be reboxed via build.
Sourcepub fn shape(&self) -> &OperatorShape
pub fn shape(&self) -> &OperatorShape
Return a reference to the operator’s shape
Sourcepub fn operator_info(&self) -> OperatorInfo
pub fn operator_info(&self) -> OperatorInfo
Creates operator info for the operator.
Trait Implementations§
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>where
T: Unpin,
impl<'scope, T> UnsafeUnpin for OperatorBuilder<'scope, T>
impl<'scope, T> !UnwindSafe for OperatorBuilder<'scope, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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