pub struct TextRange<'a> {
pub(crate) node: Node<'a>,
pub(crate) start: InnerPosition<'a>,
pub(crate) end: InnerPosition<'a>,
}Fields§
§node: Node<'a>§start: InnerPosition<'a>§end: InnerPosition<'a>Implementations§
Source§impl<'a> Range<'a>
impl<'a> Range<'a>
fn new(node: Node<'a>, start: InnerPosition<'a>, end: InnerPosition<'a>) -> Self
pub fn node(&self) -> &Node<'a>
pub fn start(&self) -> Position<'a>
pub fn end(&self) -> Position<'a>
pub fn is_degenerate(&self) -> bool
fn walk<F, T>(&self, f: F) -> Option<T>
pub fn text(&self) -> String
pub fn write_text<W: Write>(&self, writer: W) -> Result
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>
fn fix_start_bias(&mut self)
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 Eq for Range<'_>
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.