Crate data_router

source ·
Expand description

A library for creating event-based applications

§Overview

The library consists of 2 traits:

  • Receive: a generic interface for sending events
  • View: a generic interface for viewing events

Viewer return;

Receiver return, ReceiverResult:

  • Continue: continue processing the output as normal (like Some)
  • Stop: stop processing the output (like None`)
  • Delete: gives back the event with the flag that the receiver should be deleted, this is specifically for communication with routers so that intercepts can be cleanly destructed while letting the event pass through

The different ways to store receivers and viewers are:

  • RcLinker and ArcLinker: a mutexed container for a type that will invalidate any instances of [RcLinked] or [ArcLinked] ready for deletion when dropped, cleaning up any dangling references.
  • Exposed: a container for a receiver that allows multiple Views to be prepended
  • Router: a container for a receiver that allows another router to intercept the event at the beginning, by repeating the intercept function it will be delegated to lower routers, allowing a level of abstraction where an intercept does what is expected without breaking the rest of the route.

Modules§