data-router 0.2.0

data-router
Documentation

A library for creating event-based applications

Overview

The library consists of 2 traits:

  • [Receive][receive::Receive]: a generic interface for sending events
  • [View][view::View]: a generic interface for viewing events

Viewer return;

  • [DeleteView][view::DeleteView]: flag to delete the viewer

Receiver return, [ReceiverResult][receive::ReceiverResult]:

  • [Continue][receive::ReceiverResult::Continue]: continue processing the output as normal (like [Some])
  • [Stop][receive::ReceiverResult::Stop]: stop processing the output (like [None]`)
  • [Delete][receive::ReceiverResult::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][rc_linker::RcLinker] and [ArcLinker][arc_linker::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][exposed::Exposed]: a container for a receiver that allows multiple [View][view::View]s to be prepended
  • [Router][router::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.