pub struct Text {
pub tags: Box<Tags>,
pub records: Records<(usize, usize, usize)>,
/* private fields */
}Expand description
The text in a given area.
Fields§
§records: Records<(usize, usize, usize)>Implementations§
source§impl Text
impl Text
pub fn new() -> Self
pub fn from_file(path: impl AsRef<Path>) -> Self
pub fn builder() -> Builder
pub fn insert_tag(&mut self, at: usize, tag: Tag, marker: Marker)
pub fn slices(&self) -> (&str, &str)
pub fn slices_range(&self, range: impl RangeBounds<usize>) -> (&str, &str)
pub fn chars(&self) -> impl Iterator<Item = char> + Clone + '_
pub fn is_empty(&self) -> bool
pub fn get_point_at(&self, at: usize) -> Option<Point>
pub fn ghost_max_points_at(&self, at: usize) -> Option<(Point, Option<Point>)>
sourcepub fn points_after(&self, tp: impl TwoPoints) -> Option<(Point, Option<Point>)>
pub fn points_after(&self, tp: impl TwoPoints) -> Option<(Point, Option<Point>)>
Points visually after the [TwoPoints]
If the [TwoPoints] in question is concealed, treats the
next visible character as the first character, and returns
the points of the next visible character.
This method is useful if you want to iterater reversibly right after a certain point, thus including the character of said point.
pub fn len_bytes(&self) -> usize
pub fn len_chars(&self) -> usize
pub fn len_lines(&self) -> usize
pub fn max_point(&self) -> Point
sourcepub fn visual_line_start(&self, p: impl TwoPoints) -> (Point, Option<Point>)
pub fn visual_line_start(&self, p: impl TwoPoints) -> (Point, Option<Point>)
source§impl Text
impl Text
pub fn iter(&self) -> Iter<'_> ⓘ
pub fn iter_at(&self, p: impl TwoPoints) -> Iter<'_> ⓘ
pub fn rev_iter(&self) -> RevIter<'_> ⓘ
pub fn rev_iter_at(&self, p: impl TwoPoints) -> RevIter<'_> ⓘ
pub fn iter_bytes_at(&self, b: usize) -> impl Iterator<Item = u8> + '_
pub fn iter_chars_at(&self, c: usize) -> impl Iterator<Item = char> + '_
Trait Implementations§
source§impl PartialEq for Text
impl PartialEq for Text
impl Eq for Text
Auto Trait Implementations§
impl Freeze for Text
impl !RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl !UnwindSafe for Text
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)