pub struct Native<T: NativeView> { /* private fields */ }Expand description
A wrapper for platform-specific native UI components.
Native<T> allows embedding platform-specific UI elements within the view hierarchy.
The generic parameter T represents the platform-specific component type.
§Panics
Attempting to render a Native<T> view directly will panic. This type is intended
to be handled by platform-specific rendering backends.
Implementations§
Source§impl<T: NativeView> Native<T>
impl<T: NativeView> Native<T>
Sourcepub const fn new(native: T) -> Self
pub const fn new(native: T) -> Self
Creates a new Native<T> view wrapping the given native component.
§Arguments
native- The platform-specific native UI component to wrap.
Sourcepub fn with_fallback(self, fallback: impl View) -> Self
pub fn with_fallback(self, fallback: impl View) -> Self
Sets a fallback view to be used if the native view cannot be rendered.
§Arguments
fallback- The fallback view to display.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the wrapper and returns the inner native component.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Native<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Native<T>
impl<T> !Send for Native<T>
impl<T> !Sync for Native<T>
impl<T> Unpin for Native<T>where
T: Unpin,
impl<T> !UnwindSafe for Native<T>
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