Skip to main content

Target

Trait Target 

Source
pub trait Target:
    Clone
    + Debug
    + Eq
    + 'static {
    // Required methods
    fn render_self_into(&self, path: &mut Vec<String>);
    fn render_path_into(&self, path: &mut Vec<String>);
    fn parse_path(path: &[&str]) -> Option<Self>;

    // Provided methods
    fn render_self(&self) -> Vec<String> { ... }
    fn render_path(&self) -> Vec<String> { ... }
}
Expand description

A target for used by a router.

Required Methods§

Source

fn render_self_into(&self, path: &mut Vec<String>)

Render only our own path component.

Source

fn render_path_into(&self, path: &mut Vec<String>)

Render the full path downwards.

Source

fn parse_path(path: &[&str]) -> Option<Self>

Parse the target from the provided (segmented) path.

The path will be the local path, with the prefix already removed.

Provided Methods§

Source

fn render_self(&self) -> Vec<String>

Render only our path segment.

Source

fn render_path(&self) -> Vec<String>

Render the full path, including our children.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§