pub enum CharSet {
Matrix,
Ascii,
Hex,
Binary,
Custom(Vec<char>),
}Expand description
Source of glyphs for the falling drops.
Each variant resolves to a slice of single-cell characters drawn from
randomly per cell at spawn (and per cell per frame when mutation_rate > 0).
§Example
use matrix_rain::{CharSet, MatrixConfig};
let cfg = MatrixConfig::builder()
.charset(CharSet::Hex)
.build()
.unwrap();
assert!(matches!(cfg.charset, CharSet::Hex));Variants§
Matrix
Half-width katakana U+FF66..=U+FF9D plus digits 0..=9 (66 glyphs).
The canonical Matrix look.
Ascii
Printable ASCII 0x21..=0x7E (94 glyphs; space is excluded so the
rain stays visually dense).
Hex
Lowercase hexadecimal: 0–9 and a–f (16 glyphs).
Binary
Just 0 and 1.
Custom(Vec<char>)
User-supplied glyph list. Validated at
MatrixConfigBuilder::build time:
must be non-empty and free of char::is_control characters. Display
width is not validated — see the crate-level Caveats.
Trait Implementations§
impl Eq for CharSet
impl StructuralPartialEq for CharSet
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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