RenderVm

Trait RenderVm 

Source
pub trait RenderVm<'m>: Sized + FontIndice<'m> {
    type Resultant;
    type Group: GroupContext<Self> + TransformContext<Self> + Into<Self::Resultant>;

    // Required methods
    fn get_item(&self, value: &Fingerprint) -> Option<&'m VecItem>;
    fn start_group(&mut self, value: &Fingerprint) -> Self::Group;

    // Provided methods
    fn start_frame(
        &mut self,
        value: &Fingerprint,
        _group: &GroupRef,
    ) -> Self::Group { ... }
    fn start_text(
        &mut self,
        value: &Fingerprint,
        _text: &TextItem,
    ) -> Self::Group { ... }
    fn render_item(&mut self, abs_ref: &Fingerprint) -> Self::Resultant { ... }
    fn render_group(
        &mut self,
        abs_ref: &Fingerprint,
        group: &GroupRef,
    ) -> Self::Resultant { ... }
    fn render_transformed_item(
        &mut self,
        abs_ref: &Fingerprint,
        transformed: &TransformedRef,
    ) -> Self::Resultant { ... }
    fn render_labelled_item(
        &mut self,
        abs_ref: &Fingerprint,
        labelled: &LabelledRef,
    ) -> Self::Resultant { ... }
    fn render_text(
        &mut self,
        group_ctx: Self::Group,
        _abs_ref: &Fingerprint,
        text: &TextItem,
    ) -> Self::Group { ... }
}
Expand description

A virtual machine for rendering a frame. This is a stateful object that is used to render a frame. The ’m lifetime is the lifetime of the module which stores the frame data.

Required Associated Types§

Required Methods§

Source

fn get_item(&self, value: &Fingerprint) -> Option<&'m VecItem>

Source

fn start_group(&mut self, value: &Fingerprint) -> Self::Group

Provided Methods§

Source

fn start_frame(&mut self, value: &Fingerprint, _group: &GroupRef) -> Self::Group

Source

fn start_text(&mut self, value: &Fingerprint, _text: &TextItem) -> Self::Group

Source

fn render_item(&mut self, abs_ref: &Fingerprint) -> Self::Resultant

Render an item into the a <g/> element.

Source

fn render_group( &mut self, abs_ref: &Fingerprint, group: &GroupRef, ) -> Self::Resultant

Render a frame group into underlying context.

Source

fn render_transformed_item( &mut self, abs_ref: &Fingerprint, transformed: &TransformedRef, ) -> Self::Resultant

Render a transformed frame into underlying context.

Source

fn render_labelled_item( &mut self, abs_ref: &Fingerprint, labelled: &LabelledRef, ) -> Self::Resultant

Render a labelled frame into underlying context.

Source

fn render_text( &mut self, group_ctx: Self::Group, _abs_ref: &Fingerprint, text: &TextItem, ) -> Self::Group

Render a text into the underlying context.

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.

Implementors§