KeylikeExt

Trait KeylikeExt 

Source
pub trait KeylikeExt<const MCL: usize, const MCC: usize, const MPL: usize, S>: Keylike<MCL, MCC, MPL, S> {
    // Provided methods
    fn wdm_key_eq<OtherKey>(&self, other: &OtherKey) -> bool
       where OtherKey: Keylike<MCL, MCC, MPL, S>,
             S: PartialEq { ... }
    fn wdm_key_ne<OtherKey>(&self, other: &OtherKey) -> bool
       where OtherKey: Keylike<MCL, MCC, MPL, S>,
             S: PartialEq { ... }
}
Expand description

Methods for working with Keylikes.

This trait is automatically implemented by all types implementing Keylike.

Provided Methods§

Source

fn wdm_key_eq<OtherKey>(&self, other: &OtherKey) -> bool
where OtherKey: Keylike<MCL, MCC, MPL, S>, S: PartialEq,

Returns whether self and other describe equal keys, i.e., whether their subspace ids and paths are both equal.

§Examples
use willow_data_model::prelude::*;

assert!(("alfie", Path::<4, 4, 4>::new()).wdm_key_eq(&("alfie", Path::<4, 4, 4>::new())));
assert!(!("alfie", Path::<4, 4, 4>::new()).wdm_key_eq(&("betty", Path::<4, 4, 4>::new())));
Source

fn wdm_key_ne<OtherKey>(&self, other: &OtherKey) -> bool
where OtherKey: Keylike<MCL, MCC, MPL, S>, S: PartialEq,

Returns whether self and other describe non-equal keys, i.e., whether their subspace ids and paths are not both equal.

§Examples
use willow_data_model::prelude::*;

assert!(!("alfie", Path::<4, 4, 4>::new()).wdm_key_ne(&("alfie", Path::<4, 4, 4>::new())));
assert!(("alfie", Path::<4, 4, 4>::new()).wdm_key_ne(&("betty", Path::<4, 4, 4>::new())));

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<const MCL: usize, const MCC: usize, const MPL: usize, S, T> KeylikeExt<MCL, MCC, MPL, S> for T
where T: Keylike<MCL, MCC, MPL, S>,