Skip to main content

Cluster

Trait Cluster 

Source
pub trait Cluster {
    type Vertex;
    type Edge;
    type Path: Clone;
    type Point: Clone;

    // Required methods
    fn unit_path() -> Self::Path;
    fn unit_point() -> Self::Point;
    fn compress(left: &Self::Path, right: &Self::Path) -> Self::Path;
    fn rake(left: &Self::Point, right: &Self::Point) -> Self::Point;
    fn add_edge(path: &Self::Path) -> Self::Point;
    fn add_vertex(
        point: &Self::Point,
        vertex: &Self::Vertex,
        parent_edge: Option<&Self::Edge>,
    ) -> Self::Path;

    // Provided method
    fn vertex(
        vertex: &Self::Vertex,
        parent_edge: Option<&Self::Edge>,
    ) -> Self::Path { ... }
}

Required Associated Types§

Required Methods§

Source

fn unit_path() -> Self::Path

Source

fn unit_point() -> Self::Point

Source

fn compress(left: &Self::Path, right: &Self::Path) -> Self::Path

Source

fn rake(left: &Self::Point, right: &Self::Point) -> Self::Point

Source

fn add_edge(path: &Self::Path) -> Self::Point

Source

fn add_vertex( point: &Self::Point, vertex: &Self::Vertex, parent_edge: Option<&Self::Edge>, ) -> Self::Path

Provided Methods§

Source

fn vertex(vertex: &Self::Vertex, parent_edge: Option<&Self::Edge>) -> Self::Path

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§