Trait veloren_common::terrain::sprite::Attribute

source ·
pub trait Attribute: Default + Sized {
    type Error: Debug;

    const INDEX: usize;
    const BITS: u8;

    // Required methods
    fn from_bits(bits: u16) -> Result<Self, Self::Error>;
    fn into_bits(self) -> u16;
}

Required Associated Types§

source

type Error: Debug

The error that might occur when decoding the attribute from bits.

Required Associated Constants§

source

const INDEX: usize

The unique index assigned to this attribute, used to index offset arrays.

source

const BITS: u8

The number of bits required to represent this attribute.

Required Methods§

source

fn from_bits(bits: u16) -> Result<Self, Self::Error>

source

fn into_bits(self) -> u16

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Attribute for Damage

source§

const INDEX: usize = 3usize

source§

const BITS: u8 = 3u8

§

type Error = Infallible

source§

impl Attribute for Growth

source§

const INDEX: usize = 1usize

source§

const BITS: u8 = 4u8

§

type Error = Infallible

source§

impl Attribute for LightEnabled

source§

const INDEX: usize = 2usize

source§

const BITS: u8 = 1u8

§

type Error = Infallible

source§

impl Attribute for Ori

source§

const INDEX: usize = 0usize

source§

const BITS: u8 = 4u8

§

type Error = Infallible

source§

impl Attribute for Owned

source§

const INDEX: usize = 4usize

source§

const BITS: u8 = 1u8

§

type Error = Infallible