pub struct PaletteRon { /* private fields */ }Expand description
A palette file (palette, .ron), checked as
PaletteDef::from_source says against the colours the game
requires.
Implementations§
Source§impl PaletteRon
impl PaletteRon
Sourcepub fn requiring<S: Into<String>>(required: impl IntoIterator<Item = S>) -> Self
pub fn requiring<S: Into<String>>(required: impl IntoIterator<Item = S>) -> Self
A palette that must hold every colour of required.
Trait Implementations§
Source§impl Clone for PaletteRon
impl Clone for PaletteRon
Source§fn clone(&self) -> PaletteRon
fn clone(&self) -> PaletteRon
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PaletteRon
impl Debug for PaletteRon
Source§impl Default for PaletteRon
impl Default for PaletteRon
Source§fn default() -> PaletteRon
fn default() -> PaletteRon
Returns the “default value” for a type. Read more
impl Eq for PaletteRon
Source§impl Format for PaletteRon
impl Format for PaletteRon
Source§type Asset = PaletteDef
type Asset = PaletteDef
The kind it reads.
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
Stable id, e.g.
"png", "tiled-tmx", "yarn": one per format
of a kind.Source§fn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
File extensions this format claims, lowercase, without the dot. A
format that only stands in another’s place (a one-bit picture at a
PNG’s path) claims none and is found by
sniff.Source§fn max_bytes(&self) -> usize
fn max_bytes(&self) -> usize
The most bytes it reads: a bigger file is refused before
decode sees it. DEFAULT_MAX_BYTES unless the
format says.Source§fn decode(
&self,
file: &AssetPath,
bytes: &[u8],
_cx: &DecodeCx<'_>,
) -> Result<PaletteDef, Vec<ContentError>>
fn decode( &self, file: &AssetPath, bytes: &[u8], _cx: &DecodeCx<'_>, ) -> Result<PaletteDef, Vec<ContentError>>
Every problem found, each with file and place; never a panic.
Source§impl PartialEq for PaletteRon
impl PartialEq for PaletteRon
impl StructuralPartialEq for PaletteRon
Auto Trait Implementations§
impl Freeze for PaletteRon
impl RefUnwindSafe for PaletteRon
impl Send for PaletteRon
impl Sync for PaletteRon
impl Unpin for PaletteRon
impl UnsafeUnpin for PaletteRon
impl UnwindSafe for PaletteRon
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