pub struct Content<R = Renderer>(/* private fields */)
where
R: Renderer;Expand description
The content of a TextEditor.
Implementations§
Source§impl<R> Content<R>where
R: Renderer,
impl<R> Content<R>where
R: Renderer,
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Returns the amount of lines of the Content.
Sourcepub fn line(&self, index: usize) -> Option<Line<'_>>
pub fn line(&self, index: usize) -> Option<Line<'_>>
Returns the text of the line at the given index, if it exists.
Sourcepub fn lines(&self) -> impl Iterator<Item = Line<'_>>
pub fn lines(&self) -> impl Iterator<Item = Line<'_>>
Returns an iterator of the text of the lines in the Content.
Sourcepub fn line_ending(&self) -> Option<LineEnding>
pub fn line_ending(&self) -> Option<LineEnding>
Returns the kind of LineEnding used for separating lines in the Content.
Trait Implementations§
Auto Trait Implementations§
impl<R = Renderer> !Freeze for Content<R>
impl<R = Renderer> !RefUnwindSafe for Content<R>
impl<R> Send for Content<R>
impl<R = Renderer> !Sync for Content<R>
impl<R> Unpin for Content<R>
impl<R> UnsafeUnpin for Content<R>
impl<R> UnwindSafe for Content<R>
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