Skip to main content

Block

Trait Block 

Source
pub trait Block: Sized {
    type Track: Track;
    type Extra;
    type Coord;

    // Required methods
    fn extra_data(&self) -> Self::Extra;
    fn pos(&self) -> (Self::Coord, Self::Coord, Self::Coord);
    fn rot(&self) -> u8;
    fn decode(
        data: &[u8],
        offset: &mut usize,
        id: u8,
        meta: <Self::Track as Track>::Metadata,
    ) -> Option<Self>;
    fn encode(&self, data: &mut Vec<u8>, meta: <Self::Track as Track>::Metadata);
}

Required Associated Types§

Required Methods§

Source

fn extra_data(&self) -> Self::Extra

Source

fn pos(&self) -> (Self::Coord, Self::Coord, Self::Coord)

Source

fn rot(&self) -> u8

Source

fn decode( data: &[u8], offset: &mut usize, id: u8, meta: <Self::Track as Track>::Metadata, ) -> Option<Self>

Source

fn encode(&self, data: &mut Vec<u8>, meta: <Self::Track as Track>::Metadata)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§