Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime { /* private fields */ }

Implementations§

Source§

impl Runtime

Source

pub fn new() -> Self

Source

pub fn window_id(&self) -> WindowId

Source

pub fn set_window_id(&self, id: WindowId)

Source

pub fn window_size(&self) -> Signal<Size>

Source

pub fn window_size_value(&self) -> Size

Source

pub fn window_rect(&self) -> Rect

Source

pub fn viewport_rect(&self) -> Rect

Source

pub fn set_root_fill(&self, enabled: bool)

Source

pub fn scale(&self) -> f32

Source

pub fn set_scale(&self, scale: f32)

Source

pub fn safe_insets(&self) -> Edges

Source

pub fn set_safe_insets(&self, insets: Edges)

Source

pub fn set_environment(&self, env: Environment)

Source

pub fn set_redraw_hook(&self, hook: impl Fn() + 'static)

Source

pub fn request_frame(&self)

Source

pub fn clock(&self) -> FrameClock

Snapshot of the frame clock used by every view animation.

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed_secs(&self) -> f32

Source

pub fn frame_dt_secs(&self) -> f32

Source

pub fn reduced_motion(&self) -> bool

Source

pub fn set_reduced_motion(&self, reduced: bool)

Source

pub fn set_animation_speed(&self, speed: f32)

Source

pub fn animation_speed(&self) -> f32

Source

pub fn set_manual_clock(&self, manual: bool)

Switch to explicit time control. Hosts and tests can then call Runtime::advance_for_test without coupling to wall time.

Source

pub fn advance_for_test(&self, dt: Duration)

Advance the shared clock by an exact duration.

This also flips the clock into manual mode, so subsequent tick calls do not advance it from the wall clock.

Source

pub fn reset_clock(&self)

Source

pub fn live_f32( &self, el: ElementId, prop: Prop, target: f32, tween: Option<&AnimSpec>, spring: Option<&SpringSpec>, ) -> (f32, bool)

Source

pub fn live_color( &self, el: ElementId, prop: Prop, target: Color, tween: Option<&AnimSpec>, ) -> (Color, bool)

Source

pub fn live_color_exp( &self, el: ElementId, prop: Prop, target: Color, rate: f32, ) -> (Color, bool)

Source

pub fn live_vec2( &self, el: ElementId, prop: Prop, target: Vec2, tween: Option<&AnimSpec>, spring: Option<&SpringSpec>, ) -> (Vec2, bool)

Source

pub fn resolve_live_f32( &self, el: ElementId, prop: Prop, live: &Live<f32>, ) -> f32

Source

pub fn resolve_live_vec2( &self, el: ElementId, prop: Prop, live: &Live<Vec2>, ) -> Vec2

Source

pub fn live_anim_count(&self) -> usize

Source

pub fn shapes(&self) -> &ShapeCache

Source

pub fn mount(&self, root: impl View + 'static)

Source

pub fn mount_any(&self, root: AnyView)

Source

pub fn with_state<S: Default + 'static, R>( &self, el: ElementId, f: impl FnOnce(&mut S) -> R, ) -> R

Source

pub fn read_state<S: Default + 'static, R>( &self, el: ElementId, f: impl FnOnce(&S) -> R, ) -> R

Source

pub fn state_count(&self) -> usize

Source

pub fn has_state(&self, el: ElementId) -> bool

Source

pub fn track_scoped(&self, el: ElementId, cancel: impl FnOnce() + 'static)

Source

pub fn scoped_count(&self) -> usize

Source

pub fn request_rebuild(&self, el: ElementId)

Source

pub fn tick(&self)

Source

pub fn root(&self) -> Option<ElementId>

Source

pub fn is_alive(&self, id: ElementId) -> bool

Source

pub fn children(&self, id: ElementId) -> Vec<ElementId>

Source

pub fn children_len(&self, id: ElementId) -> usize

Source

pub fn key_of(&self, id: ElementId) -> Option<u64>

Source

pub fn rect_of(&self, id: ElementId) -> Option<Rect>

Source

pub fn find_by_test_id(&self, test_id: &str) -> Option<ElementId>

Source

pub fn element_count(&self) -> usize

Source

pub fn stats(&self) -> Stats

Source

pub fn errors(&self) -> Vec<RuntimeError>

Source

pub fn errors_seq(&self) -> Signal<u64>

Source

pub fn clear_errors(&self)

Source

pub fn is_descendant_of(&self, el: ElementId, ancestor: ElementId) -> bool

Source

pub fn interact(&self) -> InteractState

Source

pub fn pointer_pos(&self) -> Option<Point>

Source

pub fn cursor_icon(&self) -> CursorIcon

Source

pub fn type_name_of(&self, id: ElementId) -> Option<String>

Source

pub fn view<T: View + 'static>(&self, id: ElementId) -> Option<Rc<T>>

Source

pub fn layout(&self, bounds: Rect, text: &mut TextSystem)

Source

pub fn paint(&self, list: &mut RenderList, text: &mut TextSystem)

Source

pub fn take_surface_draws(&self) -> Vec<SurfaceDraw>

Source

pub fn hit_test(&self, pos: Point) -> Option<ElementId>

Source

pub fn pointer_move(&self, pos: Point, text: &mut TextSystem)

Source

pub fn pointer_down( &self, pos: Point, button: PointerButton, mods: Modifiers, text: &mut TextSystem, )

Source

pub fn pointer_up( &self, pos: Point, button: PointerButton, mods: Modifiers, text: &mut TextSystem, )

Source

pub fn wheel( &self, pos: Point, delta: Vec2, modifiers: Modifiers, text: &mut TextSystem, )

Source

pub fn pointer_pressure(&self) -> f32

Source

pub fn pointer_tool(&self) -> PenTool

Source

pub fn active_touches(&self) -> Vec<(u64, Point)>

Source

pub fn pen_down( &self, pos: Point, button: PointerButton, pressure: f32, tilt: Vec2, tool: PenTool, mods: Modifiers, text: &mut TextSystem, )

Source

pub fn pen_move( &self, pos: Point, pressure: f32, tilt: Vec2, tool: PenTool, text: &mut TextSystem, )

Source

pub fn pen_up( &self, pos: Point, button: PointerButton, pressure: f32, mods: Modifiers, text: &mut TextSystem, )

Source

pub fn touch_down( &self, id: u64, pos: Point, force: Option<f32>, mods: Modifiers, text: &mut TextSystem, )

Source

pub fn touch_move( &self, id: u64, pos: Point, force: Option<f32>, text: &mut TextSystem, )

Source

pub fn touch_up( &self, id: u64, pos: Point, mods: Modifiers, text: &mut TextSystem, )

Source

pub fn pinch( &self, pos: Point, delta: f32, mods: Modifiers, text: &mut TextSystem, )

Source

pub fn key(&self, key: Key, mods: Modifiers, text: &mut TextSystem)

Source

pub fn ime(&self, event: ImeEvent, text: &mut TextSystem)

Source

pub fn files_hovered( &self, paths: Vec<PathBuf>, pos: Point, text: &mut TextSystem, )

Source

pub fn files_dropped( &self, paths: Vec<PathBuf>, pos: Point, text: &mut TextSystem, )

Source

pub fn files_cancelled(&self, text: &mut TextSystem)

Source

pub fn ime_cursor_rect(&self) -> Option<Rect>

Source

pub fn overlay_show(&self, entry: OverlayEntry) -> OverlayId

Source

pub fn overlay_hide(&self, id: OverlayId) -> bool

Source

pub fn overlay_rect(&self, id: OverlayId) -> Option<Rect>

Source

pub fn overlay_exists(&self, id: OverlayId) -> bool

Source

pub fn overlay_element(&self, id: OverlayId) -> Option<ElementId>

Source

pub fn accessibility_tree(&self) -> Vec<AccessibleNode>

Source

pub fn overlay_ids(&self) -> Vec<OverlayId>

Source

pub fn overlay_count(&self) -> usize

Source

pub fn overlay_set_position(&self, id: OverlayId, x: f32, y: f32) -> bool

Source

pub fn begin_pending( &self, source: ElementId, payload: DragPayload, origin: Point, source_rect: Rect, options: DragOptions, )

Source

pub fn current_drag(&self) -> Option<DragSession>

Source

pub fn has_pending_drag(&self) -> bool

Source

pub fn drag_target_contains(&self, el: ElementId) -> bool

Source

pub fn drop_target_at( &self, pos: Point, payload: &DragPayload, ) -> Option<ElementId>

Source

pub fn cancel_drag(&self, text: &mut TextSystem)

Source

pub fn focus_in_subtree(&self, el: ElementId) -> bool

Source

pub fn parent_of(&self, el: ElementId) -> Option<ElementId>

Source

pub fn focus_next(&self, backward: bool)

Source

pub fn set_focus(&self, el: Option<ElementId>)

Source

pub fn visual_state(&self, el: ElementId) -> VisualState

Source

pub fn pointer_cancel(&self, text: &mut TextSystem)

Source

pub fn check_root_fill( &self, root: ElementId, bounds: Rect, measured: Size, ) -> bool

Trait Implementations§

Source§

impl Clone for Runtime

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Runtime

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> ViewState for T
where T: Default + 'static,