rusty-structures 0.1.0

An experimental data structures and algorithms library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::fmt::Display;

#[derive(Clone, Copy, Debug)]
pub struct Pair<T> where T : Clone + Sized + Display + PartialEq {
    pub priority: usize,
    pub element: T
}

impl<T: Clone + Display + PartialEq> Display for Pair<T> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "priority: {}, element: {}", self.priority, self.element)
    }
}