pub struct LineBoundary<T: TextLayoutMetrics> { /* private fields */ }Expand description
A TextBoundary subclass for locating closest line breaks to a given
position.
When the given position points to a hard line break, the returned range
is the line’s content range before the hard line break, and does not contain
the given position. For instance, the line breaks at position = 1 for
“a\nb” is [0, 1), which does not contain the position 1.
Implementations§
Source§impl<T: TextLayoutMetrics> LineBoundary<T>
impl<T: TextLayoutMetrics> LineBoundary<T>
Sourcepub fn new(text_layout: T) -> LineBoundary<T>
pub fn new(text_layout: T) -> LineBoundary<T>
Creates a LineBoundary with the text and layout information.
Trait Implementations§
Source§impl<T: Clone + TextLayoutMetrics> Clone for LineBoundary<T>
impl<T: Clone + TextLayoutMetrics> Clone for LineBoundary<T>
impl<T: Copy + TextLayoutMetrics> Copy for LineBoundary<T>
Source§impl<T: Debug + TextLayoutMetrics> Debug for LineBoundary<T>
impl<T: Debug + TextLayoutMetrics> Debug for LineBoundary<T>
Source§impl<T: TextLayoutMetrics> TextBoundary for LineBoundary<T>
impl<T: TextLayoutMetrics> TextBoundary for LineBoundary<T>
Source§fn get_text_boundary_at(&self, app: &mut App, position: i32) -> TextRange
fn get_text_boundary_at(&self, app: &mut App, position: i32) -> TextRange
Returns the text boundary range that encloses the input position. Read more
Auto Trait Implementations§
impl<T> Forget for LineBoundary<T>
impl<T> Freeze for LineBoundary<T>where
T: Freeze,
impl<T> Move for LineBoundary<T>
impl<T> RefUnwindSafe for LineBoundary<T>where
T: RefUnwindSafe,
impl<T> Send for LineBoundary<T>where
T: Send,
impl<T> Sync for LineBoundary<T>where
T: Sync,
impl<T> Unpin for LineBoundary<T>where
T: Unpin,
impl<T> UnsafeUnpin for LineBoundary<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for LineBoundary<T>where
T: UnwindSafe,
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