pub struct NodeState { /* private fields */ }Expand description
Runtime state tracked for every ModifierNode.
This type is part of the internal node system API and should not be directly constructed or manipulated by external code. Modifier nodes automatically receive and manage their NodeState through the modifier chain infrastructure.
Implementations§
Source§impl NodeState
impl NodeState
Sourcepub const fn new() -> NodeState
pub const fn new() -> NodeState
Creates the state of a node that is not attached to a chain yet and has no capabilities.
Sourcepub const fn sentinel() -> NodeState
pub const fn sentinel() -> NodeState
Creates the state of a head or tail marker of a chain. A marker counts as attached and has no capabilities.
Sourcepub fn set_capabilities(&self, capabilities: NodeCapabilities)
pub fn set_capabilities(&self, capabilities: NodeCapabilities)
Records the capabilities of the node that owns this state. The chain calls it when it adds or updates the node.
Sourcepub fn capabilities(&self) -> NodeCapabilities
pub fn capabilities(&self) -> NodeCapabilities
The capabilities of the node that owns this state.
Sourcepub fn set_aggregate_child_capabilities(&self, capabilities: NodeCapabilities)
pub fn set_aggregate_child_capabilities(&self, capabilities: NodeCapabilities)
Records the union of the capabilities of the node that owns this state and of every node after it in the chain.
Sourcepub fn aggregate_child_capabilities(&self) -> NodeCapabilities
pub fn aggregate_child_capabilities(&self) -> NodeCapabilities
The union of the capabilities of the node that owns this state and of every node after it in
the chain. Compose’s aggregateChildKindSet.
Sourcepub fn set_attached(&self, attached: bool)
pub fn set_attached(&self, attached: bool)
Marks the node as attached to a chain or as detached from it.
Sourcepub fn is_attached(&self) -> bool
pub fn is_attached(&self) -> bool
Whether the node is attached to a chain. It is true after on_attach ran and before
on_detach runs.
Sourcepub fn is_sentinel(&self) -> bool
pub fn is_sentinel(&self) -> bool
Whether this state belongs to the head or tail marker of a chain. A marker is no real modifier node.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NodeState
impl !RefUnwindSafe for NodeState
impl !Sync for NodeState
impl Send for NodeState
impl Unpin for NodeState
impl UnsafeUnpin for NodeState
impl UnwindSafe for NodeState
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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 more