Backend

Struct Backend 

Source
pub struct Backend {
    pub bitmap: Option<Box<dyn Bitmap + 'static>>,
    pub bitmap_type: Option<Box<dyn Bitmap + 'static>>,
    pub position: Point,
    pub area: Area,
    pub enable: bool,
    pub visible: bool,
    pub background_color: Color,
    pub handle_all_event: bool,
    pub on_press: Option<Box<dyn FnMut(Point, &mut Handler, &mut Backend)>>,
    pub on_motion: Option<Box<dyn FnMut(Point, &mut Handler, &mut Backend)>>,
    pub on_release: Option<Box<dyn FnMut(Point, &mut Handler, &mut Backend)>>,
    pub on_message: Option<Box<dyn FnMut(&'static str, &mut Handler, &mut Backend)>>,
}

Fields§

§bitmap: Option<Box<dyn Bitmap + 'static>>§bitmap_type: Option<Box<dyn Bitmap + 'static>>§position: Point§area: Area§enable: bool§visible: bool§background_color: Color§handle_all_event: bool§on_press: Option<Box<dyn FnMut(Point, &mut Handler, &mut Backend)>>§on_motion: Option<Box<dyn FnMut(Point, &mut Handler, &mut Backend)>>§on_release: Option<Box<dyn FnMut(Point, &mut Handler, &mut Backend)>>§on_message: Option<Box<dyn FnMut(&'static str, &mut Handler, &mut Backend)>>

Implementations§

Source§

impl Backend

Source

pub fn new() -> Self

Source

pub fn set_size(&mut self, width: u16, height: u16)

Source

pub fn create_buffer(&mut self) -> Result<(), PixelabError>

Source

pub fn destroy_buffer(&mut self)

Source

pub fn overlay( &mut self, fb: &mut Box<dyn Bitmap + 'static>, ) -> Result<(), PixelabError>

Source

pub fn set_pixel( &mut self, point: Point, color: Color, ) -> Result<(), PixelabError>

Source

pub fn clear(&mut self, color: Color) -> Result<(), PixelabError>

Source

pub fn set_position(&mut self, x: u16, y: u16)

Source

pub fn check_scope(&mut self, point: Point) -> bool

Source

pub fn on_press( &mut self, f: impl 'static + FnMut(Point, &mut Handler, &mut Backend), )

Source

pub fn on_motion( &mut self, f: impl 'static + FnMut(Point, &mut Handler, &mut Backend), )

Source

pub fn on_release( &mut self, f: impl 'static + FnMut(Point, &mut Handler, &mut Backend), )

Source

pub fn on_message<F>( &mut self, f: impl 'static + FnMut(&'static str, &mut Handler, &mut Backend), )

Auto Trait Implementations§

§

impl Freeze for Backend

§

impl !RefUnwindSafe for Backend

§

impl !Send for Backend

§

impl !Sync for Backend

§

impl Unpin for Backend

§

impl !UnwindSafe for Backend

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.