pub struct Runtime { /* private fields */ }Implementations§
Source§impl Runtime
impl Runtime
pub fn new() -> Self
pub fn window_id(&self) -> WindowId
pub fn set_window_id(&self, id: WindowId)
pub fn window_size(&self) -> Signal<Size>
pub fn window_size_value(&self) -> Size
pub fn window_rect(&self) -> Rect
pub fn viewport_rect(&self) -> Rect
pub fn set_root_fill(&self, enabled: bool)
pub fn scale(&self) -> f32
pub fn set_scale(&self, scale: f32)
pub fn safe_insets(&self) -> Edges
pub fn set_safe_insets(&self, insets: Edges)
pub fn set_environment(&self, env: Environment)
pub fn set_redraw_hook(&self, hook: impl Fn() + 'static)
pub fn request_frame(&self)
Sourcepub fn clock(&self) -> FrameClock
pub fn clock(&self) -> FrameClock
Snapshot of the frame clock used by every view animation.
pub fn now(&self) -> Instant
pub fn elapsed_secs(&self) -> f32
pub fn frame_dt_secs(&self) -> f32
pub fn reduced_motion(&self) -> bool
pub fn set_reduced_motion(&self, reduced: bool)
pub fn set_animation_speed(&self, speed: f32)
pub fn animation_speed(&self) -> f32
Sourcepub fn set_manual_clock(&self, manual: bool)
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.
Sourcepub fn advance_for_test(&self, dt: Duration)
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.
pub fn reset_clock(&self)
pub fn live_f32( &self, el: ElementId, prop: Prop, target: f32, tween: Option<&AnimSpec>, spring: Option<&SpringSpec>, ) -> (f32, bool)
pub fn live_color( &self, el: ElementId, prop: Prop, target: Color, tween: Option<&AnimSpec>, ) -> (Color, bool)
pub fn live_color_exp( &self, el: ElementId, prop: Prop, target: Color, rate: f32, ) -> (Color, bool)
pub fn live_vec2( &self, el: ElementId, prop: Prop, target: Vec2, tween: Option<&AnimSpec>, spring: Option<&SpringSpec>, ) -> (Vec2, bool)
pub fn resolve_live_f32( &self, el: ElementId, prop: Prop, live: &Live<f32>, ) -> f32
pub fn resolve_live_vec2( &self, el: ElementId, prop: Prop, live: &Live<Vec2>, ) -> Vec2
pub fn live_anim_count(&self) -> usize
pub fn shapes(&self) -> &ShapeCache
pub fn mount(&self, root: impl View + 'static)
pub fn mount_any(&self, root: AnyView)
pub fn with_state<S: Default + 'static, R>( &self, el: ElementId, f: impl FnOnce(&mut S) -> R, ) -> R
pub fn read_state<S: Default + 'static, R>( &self, el: ElementId, f: impl FnOnce(&S) -> R, ) -> R
pub fn state_count(&self) -> usize
pub fn has_state(&self, el: ElementId) -> bool
pub fn track_scoped(&self, el: ElementId, cancel: impl FnOnce() + 'static)
pub fn scoped_count(&self) -> usize
pub fn request_rebuild(&self, el: ElementId)
pub fn tick(&self)
pub fn root(&self) -> Option<ElementId>
pub fn is_alive(&self, id: ElementId) -> bool
pub fn children(&self, id: ElementId) -> Vec<ElementId>
pub fn children_len(&self, id: ElementId) -> usize
pub fn key_of(&self, id: ElementId) -> Option<u64>
pub fn rect_of(&self, id: ElementId) -> Option<Rect>
pub fn find_by_test_id(&self, test_id: &str) -> Option<ElementId>
pub fn element_count(&self) -> usize
pub fn stats(&self) -> Stats
pub fn errors(&self) -> Vec<RuntimeError>
pub fn errors_seq(&self) -> Signal<u64>
pub fn clear_errors(&self)
pub fn is_descendant_of(&self, el: ElementId, ancestor: ElementId) -> bool
pub fn interact(&self) -> InteractState
pub fn pointer_pos(&self) -> Option<Point>
pub fn cursor_icon(&self) -> CursorIcon
pub fn type_name_of(&self, id: ElementId) -> Option<String>
pub fn view<T: View + 'static>(&self, id: ElementId) -> Option<Rc<T>>
pub fn layout(&self, bounds: Rect, text: &mut TextSystem)
pub fn paint(&self, list: &mut RenderList, text: &mut TextSystem)
pub fn take_surface_draws(&self) -> Vec<SurfaceDraw>
pub fn hit_test(&self, pos: Point) -> Option<ElementId>
pub fn pointer_move(&self, pos: Point, text: &mut TextSystem)
pub fn pointer_down( &self, pos: Point, button: PointerButton, mods: Modifiers, text: &mut TextSystem, )
pub fn pointer_up( &self, pos: Point, button: PointerButton, mods: Modifiers, text: &mut TextSystem, )
pub fn wheel( &self, pos: Point, delta: Vec2, modifiers: Modifiers, text: &mut TextSystem, )
pub fn pointer_pressure(&self) -> f32
pub fn pointer_tool(&self) -> PenTool
pub fn active_touches(&self) -> Vec<(u64, Point)>
pub fn pen_down( &self, pos: Point, button: PointerButton, pressure: f32, tilt: Vec2, tool: PenTool, mods: Modifiers, text: &mut TextSystem, )
pub fn pen_move( &self, pos: Point, pressure: f32, tilt: Vec2, tool: PenTool, text: &mut TextSystem, )
pub fn pen_up( &self, pos: Point, button: PointerButton, pressure: f32, mods: Modifiers, text: &mut TextSystem, )
pub fn touch_down( &self, id: u64, pos: Point, force: Option<f32>, mods: Modifiers, text: &mut TextSystem, )
pub fn touch_move( &self, id: u64, pos: Point, force: Option<f32>, text: &mut TextSystem, )
pub fn touch_up( &self, id: u64, pos: Point, mods: Modifiers, text: &mut TextSystem, )
pub fn pinch( &self, pos: Point, delta: f32, mods: Modifiers, text: &mut TextSystem, )
pub fn key(&self, key: Key, mods: Modifiers, text: &mut TextSystem)
pub fn ime(&self, event: ImeEvent, text: &mut TextSystem)
pub fn files_hovered( &self, paths: Vec<PathBuf>, pos: Point, text: &mut TextSystem, )
pub fn files_dropped( &self, paths: Vec<PathBuf>, pos: Point, text: &mut TextSystem, )
pub fn files_cancelled(&self, text: &mut TextSystem)
pub fn ime_cursor_rect(&self) -> Option<Rect>
pub fn overlay_show(&self, entry: OverlayEntry) -> OverlayId
pub fn overlay_hide(&self, id: OverlayId) -> bool
pub fn overlay_rect(&self, id: OverlayId) -> Option<Rect>
pub fn overlay_exists(&self, id: OverlayId) -> bool
pub fn overlay_element(&self, id: OverlayId) -> Option<ElementId>
pub fn accessibility_tree(&self) -> Vec<AccessibleNode>
pub fn overlay_ids(&self) -> Vec<OverlayId>
pub fn overlay_count(&self) -> usize
pub fn overlay_set_position(&self, id: OverlayId, x: f32, y: f32) -> bool
pub fn begin_pending( &self, source: ElementId, payload: DragPayload, origin: Point, source_rect: Rect, options: DragOptions, )
pub fn current_drag(&self) -> Option<DragSession>
pub fn has_pending_drag(&self) -> bool
pub fn drag_target_contains(&self, el: ElementId) -> bool
pub fn drop_target_at( &self, pos: Point, payload: &DragPayload, ) -> Option<ElementId>
pub fn cancel_drag(&self, text: &mut TextSystem)
pub fn focus_in_subtree(&self, el: ElementId) -> bool
pub fn parent_of(&self, el: ElementId) -> Option<ElementId>
pub fn focus_next(&self, backward: bool)
pub fn set_focus(&self, el: Option<ElementId>)
pub fn visual_state(&self, el: ElementId) -> VisualState
pub fn pointer_cancel(&self, text: &mut TextSystem)
pub fn check_root_fill( &self, root: ElementId, bounds: Rect, measured: Size, ) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Runtime
impl !Send for Runtime
impl !Sync for Runtime
impl !UnwindSafe for Runtime
impl Freeze for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more