pub struct NodeContent { /* private fields */ }Expand description
Safe wrapper for ArkUI_NodeContentHandle.
Implementations§
Source§impl NodeContent
impl NodeContent
Sourcepub fn from_handle(handle: ArkUIHandle) -> Self
pub fn from_handle(handle: ArkUIHandle) -> Self
Wrap an existing node-content handle.
pub fn from_napi_handle(handle: &ArkUIHandle) -> Option<Self>
Sourcepub fn handle(&self) -> ArkUIHandle
pub fn handle(&self) -> ArkUIHandle
Returns the underlying node-content handle wrapper.
Sourcepub fn add_node(&self, node: &ArkUINode) -> ArkUIResult<()>
pub fn add_node(&self, node: &ArkUINode) -> ArkUIResult<()>
Appends a child node to this content.
Sourcepub fn remove_node(&self, node: &ArkUINode) -> ArkUIResult<()>
pub fn remove_node(&self, node: &ArkUINode) -> ArkUIResult<()>
Removes a child node from this content.
Sourcepub fn insert_node(&self, node: &ArkUINode, position: i32) -> ArkUIResult<()>
pub fn insert_node(&self, node: &ArkUINode, position: i32) -> ArkUIResult<()>
Inserts a child node at the given position.
Sourcepub fn register_callback<T: Fn(&mut NodeContentEvent) + 'static>(
&mut self,
callback: T,
) -> ArkUIResult<()>
pub fn register_callback<T: Fn(&mut NodeContentEvent) + 'static>( &mut self, callback: T, ) -> ArkUIResult<()>
Registers a callback invoked when node-content events are emitted.
Sourcepub fn clear_callback(&mut self) -> ArkUIResult<()>
pub fn clear_callback(&mut self) -> ArkUIResult<()>
Unregisters the callback and releases callback resources.
Auto Trait Implementations§
impl !RefUnwindSafe for NodeContent
impl !Send for NodeContent
impl !Sync for NodeContent
impl !UnwindSafe for NodeContent
impl Freeze for NodeContent
impl Unpin for NodeContent
impl UnsafeUnpin for NodeContent
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