Skip to main content

RouteAlg

Trait RouteAlg 

Source
pub trait RouteAlg {
    type Route;
    type Selector;
    type Endpoint;

    // Required methods
    fn initial(&self) -> Self::Route;
    fn coproduct(&self, left: Self::Route, right: Self::Route) -> Self::Route;
    fn precompose(
        &self,
        selector: Self::Selector,
        route: Self::Route,
    ) -> Self::Route;
    fn lift(&self, endpoint: Self::Endpoint) -> Self::Route;
}
Expand description

Describes categorical construction and composition of routes.

Required Associated Types§

Source

type Route

The interpreter’s composed route representation.

Source

type Selector

The selector applied to a route or endpoint.

Source

type Endpoint

The homogeneous endpoint representation lifted into routes.

Required Methods§

Source

fn initial(&self) -> Self::Route

Returns the initial route.

Source

fn coproduct(&self, left: Self::Route, right: Self::Route) -> Self::Route

Forms the coproduct of two routes.

Source

fn precompose( &self, selector: Self::Selector, route: Self::Route, ) -> Self::Route

Precomposes a route with a selector.

Source

fn lift(&self, endpoint: Self::Endpoint) -> Self::Route

Lifts an endpoint into a route.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§