pub struct PaletteIndex(/* private fields */);
Expand description
A palette index.
§Example
use jascpal::{Palette, PaletteIndex, Color};
let pal = Palette::default();
assert_eq!(pal[PaletteIndex::from(0)], Color { r: 0, g: 0, b: 0 });
Trait Implementations§
Source§impl Clone for PaletteIndex
impl Clone for PaletteIndex
Source§fn clone(&self) -> PaletteIndex
fn clone(&self) -> PaletteIndex
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PaletteIndex
impl Debug for PaletteIndex
Source§impl Default for PaletteIndex
impl Default for PaletteIndex
Source§fn default() -> PaletteIndex
fn default() -> PaletteIndex
Returns the “default value” for a type. Read more
Source§impl From<u8> for PaletteIndex
impl From<u8> for PaletteIndex
Source§fn from(n: u8) -> PaletteIndex
fn from(n: u8) -> PaletteIndex
Converts to this type from the input type.
Source§impl FromStr for PaletteIndex
impl FromStr for PaletteIndex
Source§type Err = ParseIntError
type Err = ParseIntError
The associated error which can be returned from parsing.
Source§fn from_str(input: &str) -> Result<PaletteIndex, <PaletteIndex as FromStr>::Err>
fn from_str(input: &str) -> Result<PaletteIndex, <PaletteIndex as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moreSource§impl PartialEq for PaletteIndex
impl PartialEq for PaletteIndex
Source§impl TryFrom<i32> for PaletteIndex
impl TryFrom<i32> for PaletteIndex
Source§type Error = TryFromIntError
type Error = TryFromIntError
The type returned in the event of a conversion error.
Source§fn try_from(
n: i32,
) -> Result<PaletteIndex, <PaletteIndex as TryFrom<i32>>::Error>
fn try_from( n: i32, ) -> Result<PaletteIndex, <PaletteIndex as TryFrom<i32>>::Error>
Performs the conversion.
impl Copy for PaletteIndex
impl Eq for PaletteIndex
impl StructuralPartialEq for PaletteIndex
Auto Trait Implementations§
impl Freeze for PaletteIndex
impl RefUnwindSafe for PaletteIndex
impl Send for PaletteIndex
impl Sync for PaletteIndex
impl Unpin for PaletteIndex
impl UnwindSafe for PaletteIndex
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