[][src]Trait gui::Renderable

pub trait Renderable: 'static + Debug {
    fn type_id(&self) -> TypeId;
fn render(&self, renderer: &dyn Renderer, bbox: BBox, cap: &dyn Cap) -> BBox; }

A trait representing a renderable object.

Required methods

fn type_id(&self) -> TypeId

Get the TypeId of self.

fn render(&self, renderer: &dyn Renderer, bbox: BBox, cap: &dyn Cap) -> BBox

Render the renderable object.

This method just forwards the call to the given Renderer, supplying a trait object of the actual widget. The renderer is advised to honor the given BBox and is free to inquire additional state using the supplied Cap.

Loading content...

Methods

impl dyn Renderable[src]

pub fn is<T>(&self) -> bool where
    T: Renderable
[src]

Check if the widget is of type T.

pub fn downcast_ref<T>(&self) -> Option<&T> where
    T: Renderable
[src]

Downcast the widget reference to type T.

pub fn downcast_mut<T>(&mut self) -> Option<&mut T> where
    T: Renderable
[src]

Downcast the widget reference to type T.

Implementors

Loading content...