pub struct CharSet { /* private fields */ }Expand description
Ordered sequence of characters a split-flap tile can display.
Order determines which intermediate characters appear during a Sequential or Combined flip animation. Distance always travels forward (wraps around), never backward.
Implementations§
Source§impl CharSet
impl CharSet
pub fn new(chars: impl Into<Arc<[char]>>) -> Result<Self, CharSetError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn index_of(&self, ch: char) -> Option<usize>
pub fn index_of(&self, ch: char) -> Option<usize>
O(1) index lookup for a character. Returns None if not in set.
pub fn contains(&self, ch: char) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CharSet
impl RefUnwindSafe for CharSet
impl Send for CharSet
impl Sync for CharSet
impl Unpin for CharSet
impl UnsafeUnpin for CharSet
impl UnwindSafe for CharSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more