cuprate_p2p_bucket

Trait Bucketable

Source
pub trait Bucketable:
    Sized
    + Eq
    + Clone {
    type Discriminant: Ord + AsRef<[u8]>;

    // Required method
    fn discriminant(&self) -> Self::Discriminant;
}
Expand description

A discriminant that can be computed from the type.

Required Associated Types§

Source

type Discriminant: Ord + AsRef<[u8]>

The type of the discriminant being used in the Binary tree.

Required Methods§

Source

fn discriminant(&self) -> Self::Discriminant

Method that can compute the discriminant from the item.

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.

Implementations on Foreign Types§

Source§

impl Bucketable for Ipv4Addr

Source§

type Discriminant = [u8; 2]

We are discriminating by /16 subnets.

Source§

fn discriminant(&self) -> Self::Discriminant

Implementors§