Trait klib::core::note::HasNoteId

source ·
pub trait HasNoteId {
    // Required methods
    fn id(self) -> u128;
    fn id_index(self) -> u8;
    fn from_id(id: u128) -> Res<Self>
       where Self: Sized;
    fn id_mask(notes: &[Self]) -> u128
       where Self: Sized;
    fn from_id_mask(id_mask: u128) -> Res<Vec<Self>>
       where Self: Sized;
}
Expand description

A trait which allows for encoding the note as a u128 ID.

Required Methods§

source

fn id(self) -> u128

Returns the ID of the note.

source

fn id_index(self) -> u8

Returns the position of the 1 for the ID of the note.

source

fn from_id(id: u128) -> Res<Self>
where Self: Sized,

Returns the note from the given ID.

source

fn id_mask(notes: &[Self]) -> u128
where Self: Sized,

Returns the ID mask for the given notes.

source

fn from_id_mask(id_mask: u128) -> Res<Vec<Self>>
where Self: Sized,

Returns the notes from the given ID mask.

Implementors§