Skip to main content

Labels

Trait Labels 

Source
pub trait Labels {
    type Label: ToOwned + ?Sized;
    type Config;

    // Required methods
    fn new(num_nodes: usize, config: Self::Config) -> Self;
    fn insert(
        &mut self,
        node: NodeId,
        label: <Self::Label as ToOwned>::Owned,
    ) -> Option<<Self::Label as ToOwned>::Owned>;
    fn get(&self, node: NodeId) -> Option<&Self::Label>;
    fn contains_key(&self, node: NodeId) -> bool;
    fn remove(
        &mut self,
        node: NodeId,
    ) -> Option<<Self::Label as ToOwned>::Owned>;
    fn is_empty(&self) -> bool;
}

Required Associated Types§

Required Methods§

Source

fn new(num_nodes: usize, config: Self::Config) -> Self

Source

fn insert( &mut self, node: NodeId, label: <Self::Label as ToOwned>::Owned, ) -> Option<<Self::Label as ToOwned>::Owned>

Source

fn get(&self, node: NodeId) -> Option<&Self::Label>

Source

fn contains_key(&self, node: NodeId) -> bool

Source

fn remove(&mut self, node: NodeId) -> Option<<Self::Label as ToOwned>::Owned>

Source

fn is_empty(&self) -> bool

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§

Source§

impl<Label: ToOwned> Labels for SparseLabels<Label>

Source§

type Label = Label

Source§

type Config = ()

Source§

impl<Label: Default + Clone> Labels for DenseLabels<Label>

Source§

type Label = Label

Source§

type Config = ()

Source§

impl<Label: StridableLabel + ?Sized> Labels for StriddenLabels<Label>