[−][src]Function cjdns_core::splice::is_one_hop
pub fn is_one_hop<L: LabelBits>(
label: RoutingLabel<L>,
encoding_scheme: &EncodingScheme
) -> Result<bool>
Tests if a label
contains only one hop.
The encoding_scheme
argument is the one used by the node which is at the beginning of the path given by the label
.
assert_eq!(is_one_hop(l("0000.0000.0000.0013"), &schemes::V358), Ok(true)); assert_eq!(is_one_hop(l("0000.0000.0000.0015"), &schemes::V358), Ok(true)); assert_eq!(is_one_hop(l("0000.0000.0000.0153"), &schemes::V358), Ok(false));