Skip to main content

BoxOutput

Trait BoxOutput 

Source
pub trait BoxOutput: PineOutput {
    // Required methods
    fn add_box(&mut self, box_obj: PineBox) -> usize;
    fn get_box(&self, id: usize) -> Option<&PineBox>;
    fn get_box_mut(&mut self, id: usize) -> Option<&mut PineBox>;
    fn delete_box(&mut self, id: usize) -> bool;
}
Expand description

Extension trait for box output

Required Methods§

Source

fn add_box(&mut self, box_obj: PineBox) -> usize

Add a box and return its ID

Source

fn get_box(&self, id: usize) -> Option<&PineBox>

Get a reference to a box by ID

Source

fn get_box_mut(&mut self, id: usize) -> Option<&mut PineBox>

Get a mutable reference to a box by ID

Source

fn delete_box(&mut self, id: usize) -> bool

Delete a box by ID and return true if it existed

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§