Struct pax_core::engine::PaxEngine

source ·
pub struct PaxEngine<R: 'static + RenderContext> {
    pub frames_elapsed: usize,
    pub instance_registry: Rc<RefCell<InstanceRegistry<R>>>,
    pub expression_table: HashMap<usize, Box<dyn Fn(ExpressionContext<'_, R>) -> TypesCoproduct>>,
    pub main_component: Rc<RefCell<ComponentInstance<R>>>,
    pub runtime: Rc<RefCell<Runtime<R>>>,
    pub image_map: HashMap<Vec<u32>, (Box<Vec<u8>>, usize, usize)>,
    /* private fields */
}

Fields§

§frames_elapsed: usize§instance_registry: Rc<RefCell<InstanceRegistry<R>>>§expression_table: HashMap<usize, Box<dyn Fn(ExpressionContext<'_, R>) -> TypesCoproduct>>§main_component: Rc<RefCell<ComponentInstance<R>>>§runtime: Rc<RefCell<Runtime<R>>>§image_map: HashMap<Vec<u32>, (Box<Vec<u8>>, usize, usize)>

Implementations§

source§

impl<R: 'static + RenderContext> PaxEngine<R>

source

pub fn new( main_component_instance: Rc<RefCell<ComponentInstance<R>>>, expression_table: HashMap<usize, Box<dyn Fn(ExpressionContext<'_, R>) -> TypesCoproduct>>, logger: PlatformSpecificLogger, viewport_size: (f64, f64), instance_registry: Rc<RefCell<InstanceRegistry<R>>> ) -> Self

source

pub fn get_topmost_element_beneath_ray( &self, ray: (f64, f64) ) -> Option<Rc<RepeatExpandedNode<R>>>

Simple 2D raycasting: the coordinates of the ray represent a ray running orthogonally to the view plane, intersecting at the specified point ray. Areas outside of clipping bounds will not register a hit, nor will elements that suppress input events.

source

pub fn get_focused_element(&self) -> Option<Rc<RepeatExpandedNode<R>>>

source

pub fn set_viewport_size(&mut self, new_viewport_size: (f64, f64))

Called by chassis when viewport size changes, e.g. with native window resizes

source

pub fn tick(&mut self, rcs: &mut HashMap<String, R>) -> Vec<NativeMessage>

Workhorse method to advance rendering and property calculation by one discrete tick Will be executed synchronously up to 240 times/second.

source

pub fn load_image( &mut self, id_chain: Vec<u32>, image_data: Vec<u8>, width: usize, height: usize )

Auto Trait Implementations§

§

impl<R> !RefUnwindSafe for PaxEngine<R>

§

impl<R> !Send for PaxEngine<R>

§

impl<R> !Sync for PaxEngine<R>

§

impl<R> Unpin for PaxEngine<R>

§

impl<R> !UnwindSafe for PaxEngine<R>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> RoundFrom<T> for T

source§

fn round_from(x: T) -> T

Performs the conversion.
source§

impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,

source§

fn round_into(self) -> U

Performs the conversion.
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.