pub struct OperatorWriteOutput {
pub write_prologue: TokenStream,
pub write_prologue_after: TokenStream,
pub write_iterator: TokenStream,
pub write_iterator_after: TokenStream,
pub write_tick_end: TokenStream,
}Expand description
The code generated and returned by a OperatorConstraints::write_fn.
Important: When destructuring this struct in delegating operators, list all fields
explicitly rather than using .. to ensure new fields are not silently dropped.
Fields§
§write_prologue: TokenStreamCode which runs once outside any subgraphs, BEFORE subgraphs are initialized, to set up any external state (state API, chanels, network connections, etc.) to be used by the subgraph.
write_prologue_after: TokenStreamCode which runs once outside the subgraph, AFTER subgraphs are initialized, to set up state hooks which may need the subgraph ID.
write_iterator: TokenStreamIterator (or pusherator) code inside the subgraphs. The code for each operator is emitted in order.
Emitted code should assign to WriteContextArgs::ident and use
WriteContextArgs::inputs (pull Streams) or
WriteContextArgs::outputs (push Sinks).
write_iterator_after: TokenStreamCode which runs after Streams/Sinks have been run. Mainly for flushing IO.
write_tick_end: TokenStreamCode which runs at the end of each tick, after all subgraphs have run.
Used for resetting state with 'tick persistence.
Trait Implementations§
Source§impl Default for OperatorWriteOutput
impl Default for OperatorWriteOutput
Source§fn default() -> OperatorWriteOutput
fn default() -> OperatorWriteOutput
Auto Trait Implementations§
impl Freeze for OperatorWriteOutput
impl RefUnwindSafe for OperatorWriteOutput
impl !Send for OperatorWriteOutput
impl !Sync for OperatorWriteOutput
impl Unpin for OperatorWriteOutput
impl UnsafeUnpin for OperatorWriteOutput
impl UnwindSafe for OperatorWriteOutput
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