pub struct TextRange<'a> { /* private fields */ }
Implementations§
source§impl<'a> Range<'a>
impl<'a> Range<'a>
pub fn node(&self) -> &Node<'_>
pub fn start(&self) -> Position<'a>
pub fn end(&self) -> Position<'a>
pub fn is_degenerate(&self) -> bool
pub fn text(&self) -> String
sourcepub fn bounding_boxes(&self) -> Vec<Rect>
pub fn bounding_boxes(&self) -> Vec<Rect>
Returns the range’s transformed bounding boxes relative to the tree’s container (e.g. window).
If the return value is empty, it means that the source tree doesn’t provide enough information to calculate bounding boxes. Otherwise, there will always be at least one box, even if it’s zero-width, as it is for a degenerate range.
pub fn attribute<F, T>(&self, f: F) -> AttributeValue<T>
pub fn set_start(&mut self, pos: Position<'a>)
pub fn set_end(&mut self, pos: Position<'a>)
pub fn to_text_selection(&self) -> TextSelection
pub fn downgrade(&self) -> WeakRange
Trait Implementations§
impl<'a> Copy for Range<'a>
impl<'a> Eq for Range<'a>
Auto Trait Implementations§
impl<'a> Freeze for Range<'a>
impl<'a> RefUnwindSafe for Range<'a>
impl<'a> Send for Range<'a>
impl<'a> Sync for Range<'a>
impl<'a> Unpin for Range<'a>
impl<'a> UnwindSafe for Range<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)