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§
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 Methods§
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.