Struct freya_native_core::real_dom::NodeMut
source · pub struct NodeMut<'a, V: FromAnyValue + Send + Sync = ()> { /* private fields */ }
Expand description
A mutable refrence to a node in the RealDom that tracks what States need to be updated
Implementations§
source§impl<'a, V: FromAnyValue + Send + Sync> NodeMut<'a, V>
impl<'a, V: FromAnyValue + Send + Sync> NodeMut<'a, V>
sourcepub fn real_dom_mut(&mut self) -> &mut RealDom<V>
pub fn real_dom_mut(&mut self) -> &mut RealDom<V>
Get the real dom this node was created in mutably
sourcepub fn get_mut<T: Component<Tracking = Untracked> + Sync + Send>(
&mut self
) -> Option<ViewEntryMut<'_, T>>
pub fn get_mut<T: Component<Tracking = Untracked> + Sync + Send>( &mut self ) -> Option<ViewEntryMut<'_, T>>
Get a component from the current node mutably
sourcepub fn insert<T: Component + Sync + Send>(&mut self, value: T)
pub fn insert<T: Component + Sync + Send>(&mut self, value: T)
Insert a custom component into this node
Note: Components that implement State and are added when the RealDom is created will automatically be created
sourcepub fn add_child(&mut self, child: NodeId)
pub fn add_child(&mut self, child: NodeId)
Add the given node to the end of this nodes children
sourcepub fn insert_after(&mut self, old: NodeId)
pub fn insert_after(&mut self, old: NodeId)
Insert this node after the given node
sourcepub fn insert_before(&mut self, old: NodeId)
pub fn insert_before(&mut self, old: NodeId)
Insert this node before the given node
sourcepub fn add_event_listener(&mut self, event: EventName)
pub fn add_event_listener(&mut self, event: EventName)
Add an event listener
sourcepub fn remove_event_listener(&mut self, event: &EventName)
pub fn remove_event_listener(&mut self, event: &EventName)
Remove an event listener
sourcepub fn node_type_mut(&mut self) -> NodeTypeMut<'_, V>
pub fn node_type_mut(&mut self) -> NodeTypeMut<'_, V>
Get a mutable reference to the type of the current node
sourcepub fn clone_node(&mut self) -> NodeId
pub fn clone_node(&mut self) -> NodeId
Clone a node and it’s children and returns the id of the new node. This is more effecient than creating the node from scratch because it can pre-allocate the memory required.
Trait Implementations§
source§impl<'a, V: FromAnyValue + Send + Sync> NodeImmutable<V> for NodeMut<'a, V>
impl<'a, V: FromAnyValue + Send + Sync> NodeImmutable<V> for NodeMut<'a, V>
source§fn get<'a, T: Component + Sync + Send>(&'a self) -> Option<ViewEntry<'a, T>>
fn get<'a, T: Component + Sync + Send>(&'a self) -> Option<ViewEntry<'a, T>>
Get a component from the current node
Auto Trait Implementations§
impl<'a, V> Freeze for NodeMut<'a, V>
impl<'a, V = ()> !RefUnwindSafe for NodeMut<'a, V>
impl<'a, V> Send for NodeMut<'a, V>
impl<'a, V> Sync for NodeMut<'a, V>
impl<'a, V> Unpin for NodeMut<'a, V>
impl<'a, V = ()> !UnwindSafe for NodeMut<'a, V>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T, V> NodeImmutableDioxusExt<V> for T
impl<T, V> NodeImmutableDioxusExt<V> for T
source§fn mounted_id(&self) -> Option<ElementId>
fn mounted_id(&self) -> Option<ElementId>
Returns the id of the element that this node is mounted to.
Not all nodes are mounted to an element, only nodes with dynamic content that have been renderered will have an id.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.