pub trait PlatformBridge: Send + Sync {
// Required methods
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;
}Expand description
Every platform bridge MUST implement this trait.