pub struct TextRange<'a> { /* private fields */ }Implementations§
Source§impl<'a> Range<'a>
impl<'a> Range<'a>
pub fn node(&self) -> &Node<'a>
pub fn start(&self) -> Position<'a>
pub fn end(&self) -> Position<'a>
pub fn is_degenerate(&self) -> bool
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 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
Source§impl<'a> Range<'a>
impl<'a> Range<'a>
pub fn text_direction(&self) -> RangePropertyValue<Option<TextDirection>>
pub fn font_family(&self) -> RangePropertyValue<Option<&'a str>>
pub fn language(&self) -> RangePropertyValue<Option<&'a str>>
pub fn font_size(&self) -> RangePropertyValue<Option<f32>>
pub fn font_weight(&self) -> RangePropertyValue<Option<f32>>
pub fn background_color(&self) -> RangePropertyValue<Option<Color>>
pub fn foreground_color(&self) -> RangePropertyValue<Option<Color>>
pub fn overline(&self) -> RangePropertyValue<Option<TextDecoration>>
pub fn strikethrough(&self) -> RangePropertyValue<Option<TextDecoration>>
pub fn underline(&self) -> RangePropertyValue<Option<TextDecoration>>
pub fn text_align(&self) -> RangePropertyValue<Option<TextAlign>>
pub fn vertical_offset(&self) -> RangePropertyValue<Option<VerticalOffset>>
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