#[non_exhaustive]pub enum Codepage {
Cp437,
Unicode {
start: char,
},
Identity,
Custom(Vec<char>),
}Expand description
Maps row-major tile indices in a sprite sheet to Unicode codepoints.
#[non_exhaustive] allows adding new variants (e.g. Cp1252) without a
semver break.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cp437
Standard CP437 layout: the i-th tile maps to CP437_TO_UNICODE[i].
Only the first 256 tiles in the sheet are mapped; extras are ignored.
Unicode
Starting at start, tile index i maps to char::from_u32(start as u32 + i).
Tiles that would map to a surrogate or exceed char::MAX are skipped.
Identity
Positional mapping: tile index i maps to char::from_u32(i).
This is the simplest option when you don’t care about Unicode semantics
and just want to reference tiles by a zero-based index. Use
Tile::glyph values 0, 1, 2, … to address
individual sprites in sheet order.
Tiles whose index falls in the surrogate range (0xD800–0xDFFF) are skipped; all others are valid.
Custom(Vec<char>)
Explicit mapping: tile i maps to table[i].
Tiles beyond table.len() are ignored.
Implementations§
Source§impl Codepage
impl Codepage
Trait Implementations§
impl Eq for Codepage
impl StructuralPartialEq for Codepage
Auto Trait Implementations§
impl Freeze for Codepage
impl RefUnwindSafe for Codepage
impl Send for Codepage
impl Sync for Codepage
impl Unpin for Codepage
impl UnsafeUnpin for Codepage
impl UnwindSafe for Codepage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.