pub trait ScreenBuffer: ScreenBufferCore {
type Drawer: CellDrawer + Send + 'static;
// Required methods
fn new(size: (u16, u16)) -> Self
where Self: Sized;
fn drawer_sender(&self) -> SyncSender<CellDrawerCommand>;
fn drop(&mut self);
// Provided methods
fn add_to_buffer(
&mut self,
obj: &mut DrawObject,
obj_id: ObjectId,
screen_layer: usize,
bounds: &Rect<i32>,
sprites: &SpriteRegistry,
) -> Result<(), DrawError> { ... }
fn remove_from_buffer(
&mut self,
obj: &DrawObject,
obj_id: ObjectId,
sprites: &SpriteRegistry,
bounds: &Rect<i32>,
) { ... }
fn update_terminal(&mut self, expand: usize) -> Result<(), DrawError> { ... }
fn mark_all_dirty(&mut self, new_size: (u16, u16)) { ... }
fn idx_of(&self, pos: Point<i32>) -> usize { ... }
fn handle_none_interval_creator(
&mut self,
opt_c: Option<UpdateIntervalCreator>,
shift_amount: Point<i32>,
) -> HashMap<u16, Vec<UpdateInterval>> { ... }
}
Expand description
Public API that combines the core bookkeeping with the drawing layer
Required Associated Types§
type Drawer: CellDrawer + Send + 'static
Required Methods§
fn new(size: (u16, u16)) -> Selfwhere
Self: Sized,
fn drawer_sender(&self) -> SyncSender<CellDrawerCommand>
fn drop(&mut self)
Provided Methods§
Sourcefn add_to_buffer(
&mut self,
obj: &mut DrawObject,
obj_id: ObjectId,
screen_layer: usize,
bounds: &Rect<i32>,
sprites: &SpriteRegistry,
) -> Result<(), DrawError>
fn add_to_buffer( &mut self, obj: &mut DrawObject, obj_id: ObjectId, screen_layer: usize, bounds: &Rect<i32>, sprites: &SpriteRegistry, ) -> Result<(), DrawError>
Add an object to the buffer.
Sourcefn remove_from_buffer(
&mut self,
obj: &DrawObject,
obj_id: ObjectId,
sprites: &SpriteRegistry,
bounds: &Rect<i32>,
)
fn remove_from_buffer( &mut self, obj: &DrawObject, obj_id: ObjectId, sprites: &SpriteRegistry, bounds: &Rect<i32>, )
Remove an object from the buffer.
fn update_terminal(&mut self, expand: usize) -> Result<(), DrawError>
fn mark_all_dirty(&mut self, new_size: (u16, u16))
fn idx_of(&self, pos: Point<i32>) -> usize
fn handle_none_interval_creator( &mut self, opt_c: Option<UpdateIntervalCreator>, shift_amount: Point<i32>, ) -> HashMap<u16, Vec<UpdateInterval>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.