#[repr(C)]pub struct TxNodeId {
pub index: u32,
pub generation: u32,
}Expand description
A C-compatible node identifier.
This is a #[repr(C)] mirror of the internal NodeId type. It carries
both an arena index and a generation counter for use-after-free detection.
Fields§
§index: u32Index into the document’s node arena.
generation: u32Generation counter for validity checking.
Implementations§
Source§impl TxNodeId
impl TxNodeId
Sourcepub fn from_node_id(id: NodeId) -> Self
pub fn from_node_id(id: NodeId) -> Self
Converts a Rust NodeId into a C-compatible TxNodeId.
Sourcepub fn to_node_id(self) -> NodeId
pub fn to_node_id(self) -> NodeId
Converts this C-compatible TxNodeId back into a Rust NodeId.
Sourcepub fn from_option(opt: Option<NodeId>) -> Self
pub fn from_option(opt: Option<NodeId>) -> Self
Converts an Option<NodeId> to a TxNodeId, mapping None to
TX_NULL_NODE.
Trait Implementations§
impl Copy for TxNodeId
impl Eq for TxNodeId
impl StructuralPartialEq for TxNodeId
Auto Trait Implementations§
impl Freeze for TxNodeId
impl RefUnwindSafe for TxNodeId
impl Send for TxNodeId
impl Sync for TxNodeId
impl Unpin for TxNodeId
impl UnsafeUnpin for TxNodeId
impl UnwindSafe for TxNodeId
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