Trait bpxe::flow_node::FlowNode[][src]

pub trait FlowNode: Stream<Item = Action> + Send + Unpin {
    fn set_state(&mut self, state: State) -> Result<(), StateError>;
fn get_state(&mut self) -> State;
fn element(&self) -> Box<dyn FlowNodeType>

Notable traits for Box<R, Global>

impl<R> Read for Box<R, Global> where
    R: Read + ?Sized
impl<W> Write for Box<W, Global> where
    W: Write + ?Sized
impl<F, A> Future for Box<F, A> where
    F: Unpin + Future + ?Sized,
    A: Allocator + 'static, 
type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
    A: Allocator,
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;
; fn set_process(&mut self, process: Handle) { ... }
fn sequence_flow(
        &mut self,
        outgoing: OutgoingIndex,
        sequence_flow: &SequenceFlow,
        condition_result: bool
    ) { ... }
fn handle_outgoing_action(
        &mut self,
        index: OutgoingIndex,
        action: Option<Action>
    ) -> Option<Option<Action>> { ... }
fn incoming(&mut self, index: IncomingIndex) { ... }
fn tokens(&mut self, count: usize) { ... } }

Flow node

Flow node type should also implement [futures::stream::Stream] with Item set to Action.

Required methods

fn set_state(&mut self, state: State) -> Result<(), StateError>[src]

Sets durable state

If the state variant is incorect, StateError error should be returned.

fn get_state(&mut self) -> State[src]

Gets durable state

The reason why it's mutable is that in some cases some activites might want to change their data or simply get mutable access to it during state retrieval

fn element(&self) -> Box<dyn FlowNodeType>

Notable traits for Box<R, Global>

impl<R> Read for Box<R, Global> where
    R: Read + ?Sized
impl<W> Write for Box<W, Global> where
    W: Write + ?Sized
impl<F, A> Future for Box<F, A> where
    F: Unpin + Future + ?Sized,
    A: Allocator + 'static, 
type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
    A: Allocator,
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;
[src]

Returns a flow element

Loading content...

Provided methods

fn set_process(&mut self, process: Handle)[src]

Sets process handle

This allows flow nodes to access the process they are running in.

Default implementation does nothing.

fn sequence_flow(
    &mut self,
    outgoing: OutgoingIndex,
    sequence_flow: &SequenceFlow,
    condition_result: bool
)
[src]

Reports outgoing sequence flow processing

If condition was not present or it returned a truthful result, condition_result will be set to true, otherwise it will be zero.

This allows flow nodes to make further decisions after each sequence flow processing. Flow node will be polled after this.

Default implementation does nothing.

fn handle_outgoing_action(
    &mut self,
    index: OutgoingIndex,
    action: Option<Action>
) -> Option<Option<Action>>
[src]

Maps outgoing node's action to a new action (or inaction)

This is useful for nodes with more complex processing (for example, event-based gateway) that need to handle the result action of the outgoing node.

Returning None will mean that the action has to be dropped, returning Some(action) will replace the original action with the returned one in the flow.

Default implementation does nothing (returns the same action)

fn incoming(&mut self, index: IncomingIndex)[src]

Reports incoming sequence flow

Default implementation does nothing.

fn tokens(&mut self, count: usize)[src]

Reports token count at ingress.

Useful for complex flow node behaviours where it needs to know how many outstanding tokens there are.

Default implementation does nothing.

Loading content...

Implementors

impl FlowNode for Task[src]

impl FlowNode for EndEvent[src]

impl FlowNode for IntermediateCatchEvent[src]

impl FlowNode for IntermediateThrowEvent[src]

impl FlowNode for StartEvent[src]

impl FlowNode for bpxe::gateway::event_based::Gateway[src]

impl FlowNode for bpxe::gateway::exclusive::Gateway[src]

impl FlowNode for bpxe::gateway::inclusive::Gateway[src]

impl FlowNode for bpxe::gateway::parallel::Gateway[src]

impl<T, E, F> FlowNode for ActivityContainer<T, E, F> where
    T: Activity + 'static,
    E: ActivityType + Clone + Unpin,
    F: ParameterizedFactory<Item = T, Parameter = E> + Send + Clone + Unpin + 'static, 
[src]

Loading content...