pub struct Position {
pub node: NodeId,
pub offset: usize,
}Expand description
A position within the DOM’s text content.
node: the Text node the position falls inside. v1 restricts positions to Text nodes; future work may generalize to Element positions (before/after a child).offset: byte offset into the text node’sdatastring. Bytes (not codepoints, not graphemes) — consistent with the browserRangeAPI and with how slicing works in Rust. Callers that need grapheme-level indexing convert viaunicode-segmentation.
Fields§
§node: NodeId§offset: usizeImplementations§
Trait Implementations§
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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