#[derive(Debug, Clone, Copy, PartialEq)]
pub struct TrustEdge {
pub from: usize,
pub to: usize,
pub weight: f64,
}
impl TrustEdge {
pub const fn new(from: usize, to: usize, weight: f64) -> Self {
TrustEdge { from, to, weight }
}
}
impl From<(usize, usize, f64)> for TrustEdge {
fn from((from, to, weight): (usize, usize, f64)) -> Self {
TrustEdge { from, to, weight }
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct PreTrust {
pub peer: usize,
pub weight: f64,
}
impl PreTrust {
pub const fn new(peer: usize, weight: f64) -> Self {
PreTrust { peer, weight }
}
}
impl From<(usize, f64)> for PreTrust {
fn from((peer, weight): (usize, f64)) -> Self {
PreTrust { peer, weight }
}
}