Skip to main content

RenderCommandOutputDecodable

Trait RenderCommandOutputDecodable 

Source
pub trait RenderCommandOutputDecodable<Custom>: Sized {
    // Required method
    fn decode_list(
        output: &mut RenderCommandOutput<Custom>,
        buffer: &mut Vec<Self>,
    );
}
Expand description

Walks a RenderTList type for one RenderCommandOutput, producing flattened list values.

Implemented for [()] (base case, no-op) and RenderTList<Head, Tail> (recursive case). At each level the head decoders run first, then the tail recurses.

§Examples

use cotis_defaults::render_commands::render_t_list::RenderTList;
use cotis_defaults::render_commands::{Rectangle, Text};

// Decode order for Element commands: Rectangle first, then Text.
type Cmds = RenderTList<Rectangle<'static, ()>, RenderTList<Text<'static, ()>, ()>>;

Required Methods§

Source

fn decode_list(output: &mut RenderCommandOutput<Custom>, buffer: &mut Vec<Self>)

Decodes output into zero or more values appended to buffer.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Custom, Head, Tail> RenderCommandOutputDecodable<Custom> for RenderTList<Head, Tail>

Source§

fn decode_list(output: &mut RenderCommandOutput<Custom>, buffer: &mut Vec<Self>)

Source§

impl<Custom> RenderCommandOutputDecodable<Custom> for ()

Source§

fn decode_list( _output: &mut RenderCommandOutput<Custom>, _buffer: &mut Vec<Self>, )

Implementors§