Expand description
Label for a node. The label type must be very cheap to clone and move around.
for strings, Arc
use meshed::prelude::*;
use std::rc::Rc;
#[derive(Clone)]
struct Identifier(Rc<str>);
impl std::fmt::Display for Identifier {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
todo!()
}
}
struct Data {
id: Identifier
}
impl Label for Data {
type Label = Identifier;
fn label(&self) -> Self::Label {
self.id.clone()
}
}