pub struct SelectionState { /* private fields */ }Expand description
Active single-node or cross-node character-range text selection targeting live selectable NodeKind::Text nodes.
Implementations§
Source§impl SelectionState
Character-range queries and text extraction helpers for SelectionState.
impl SelectionState
Character-range queries and text extraction helpers for SelectionState.
Sourcepub const fn get_node_id(&self) -> NodeId
pub const fn get_node_id(&self) -> NodeId
Sourcepub fn is_single_node(&self) -> bool
pub fn is_single_node(&self) -> bool
Sourcepub const fn ordered_range(&self) -> (usize, usize)
pub const fn ordered_range(&self) -> (usize, usize)
Sourcepub fn extract_from<'a>(&self, text: &'a str) -> &'a str
pub fn extract_from<'a>(&self, text: &'a str) -> &'a str
Source§impl SelectionState
impl SelectionState
pub fn get_anchor_node(&self) -> NodeId
pub fn get_mut_anchor_node(&mut self) -> &mut NodeId
pub fn set_anchor_node(&mut self, val: NodeId) -> &mut Self
pub fn get_anchor_char(&self) -> usize
pub fn get_mut_anchor_char(&mut self) -> &mut usize
pub fn set_anchor_char(&mut self, val: usize) -> &mut Self
pub fn get_focus_node(&self) -> NodeId
pub fn get_mut_focus_node(&mut self) -> &mut NodeId
pub fn set_focus_node(&mut self, val: NodeId) -> &mut Self
pub fn get_focus_char(&self) -> usize
pub fn get_mut_focus_char(&mut self) -> &mut usize
pub fn set_focus_char(&mut self, val: usize) -> &mut Self
Trait Implementations§
Source§impl Clone for SelectionState
impl Clone for SelectionState
impl Copy for SelectionState
Source§impl Debug for SelectionState
impl Debug for SelectionState
impl Eq for SelectionState
Source§impl PartialEq for SelectionState
impl PartialEq for SelectionState
impl StructuralPartialEq for SelectionState
Auto Trait Implementations§
impl Forget for SelectionState
impl Freeze for SelectionState
impl Move for SelectionState
impl RefUnwindSafe for SelectionState
impl Send for SelectionState
impl Sync for SelectionState
impl Unpin for SelectionState
impl UnsafeUnpin for SelectionState
impl UnwindSafe for SelectionState
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