pub struct WebPlatform { /* private fields */ }Expand description
Web platform bridge.
In production, each method will call through wasm-bindgen to the browser DOM.
For now, we maintain an in-memory view registry for testing and development.
Implementations§
Source§impl WebPlatform
impl WebPlatform
pub fn new() -> Self
pub fn with_screen(self, width: f32, height: f32, scale: f32) -> Self
pub fn view_count(&self) -> usize
Trait Implementations§
Source§impl Default for WebPlatform
impl Default for WebPlatform
Source§impl PlatformBridge for WebPlatform
impl PlatformBridge for WebPlatform
fn platform_id(&self) -> PlatformId
fn create_view(&self, view_type: ViewType, node_id: NodeId) -> NativeHandle
fn update_view( &self, handle: NativeHandle, _props: &PropsDiff, ) -> Result<(), PlatformError>
fn remove_view(&self, handle: NativeHandle)
fn insert_child(&self, parent: NativeHandle, child: NativeHandle, index: usize)
fn remove_child(&self, parent: NativeHandle, child: NativeHandle)
fn measure_text( &self, text: &str, style: &TextStyle, max_width: f32, ) -> TextMetrics
fn screen_size(&self) -> ScreenSize
fn scale_factor(&self) -> f32
fn supports(&self, capability: PlatformCapability) -> bool
Auto Trait Implementations§
impl !Freeze for WebPlatform
impl RefUnwindSafe for WebPlatform
impl Send for WebPlatform
impl Sync for WebPlatform
impl Unpin for WebPlatform
impl UnsafeUnpin for WebPlatform
impl UnwindSafe for WebPlatform
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