Crate data_router
source ·Expand description
A library for creating event-based applications
§Overview
The library consists of 2 traits:
Viewer return;
DeleteView
: flag to delete the viewer
Receiver return, ReceiverResult
:
Continue
: continue processing the output as normal (likeSome
)Stop
: stop processing the output (likeNone
`)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
andArcLinker
: 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 multipleView
s to be prependedRouter
: 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.