Struct ropey::RopeSlice [] [src]

pub struct RopeSlice<'a, S: 'a + GraphemeSegmenter> { /* fields omitted */ }

An immutable view into part of a Rope.

Methods

impl<'a, S: 'a + GraphemeSegmenter> RopeSlice<'a, S>
[src]

[src]

Total number of bytes in the RopeSlice.

[src]

Total number of chars in the RopeSlice.

[src]

Total number of lines in the RopeSlice.

[src]

Returns the line index of the given char.

Panics

Panics if char_idx is out of bounds (i.e. char_idx > len_chars()).

[src]

Returns the char index of the start of the given line.

Note: lines are zero-indexed.

Panics

Panics if line_idx is out of bounds (i.e. line_idx > len_lines()).

[src]

Returns the char at char_idx.

Panics

Panics if char_idx is out of bounds (i.e. char_idx >= len_chars()).

[src]

Returns the line at line_idx.

Note: lines are zero-indexed.

Panics

Panics if line_idx is out of bounds (i.e. line_idx >= len_lines()).

[src]

Returns whether char_idx is a grapheme cluster boundary or not.

Panics

Panics if char_idx is out of bounds (i.e. char_idx > len_chars()).

[src]

Returns the char index of the grapheme cluster boundary to the left of char_idx.

This excludes any boundary that might be at char_idx itself, unless char_idx is at the beginning of the rope.

Panics

Panics if char_idx is out of bounds (i.e. char_idx > len_chars()).

[src]

Returns the char index of the grapheme cluster boundary to the right of char_idx.

This excludes any boundary that might be at char_idx itself, unless char_idx is at the end of the rope.

Panics

Panics if char_idx is out of bounds (i.e. char_idx > len_chars()).

[src]

Returns a sub-slice of the RopeSlice in the given char index range.

Panics

Panics if the start of the range is greater than the end, or the end is out of bounds (i.e. end > len_chars()).

[src]

Creates an iterator over the bytes of the RopeSlice.

[src]

Creates an iterator over the chars of the RopeSlice.

[src]

Creates an iterator over the grapheme clusters of the RopeSlice.

[src]

Creates an iterator over the lines of the RopeSlice.

[src]

Creates an iterator over the chunks of the RopeSlice.

[src]

Returns the entire text of the RopeSlice as a newly allocated String.

[src]

Creates a new Rope from the contents of the RopeSlice.

Trait Implementations

impl<'a, S: Copy + 'a + GraphemeSegmenter> Copy for RopeSlice<'a, S>
[src]

impl<'a, S: Clone + 'a + GraphemeSegmenter> Clone for RopeSlice<'a, S>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a, S: GraphemeSegmenter> Debug for RopeSlice<'a, S>
[src]

[src]

Formats the value using the given formatter.

impl<'a, S: GraphemeSegmenter> Display for RopeSlice<'a, S>
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a, 'b, S1: GraphemeSegmenter, S2: GraphemeSegmenter> PartialEq<RopeSlice<'b, S2>> for RopeSlice<'a, S1>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<'a, 'b, S: GraphemeSegmenter> PartialEq<&'b str> for RopeSlice<'a, S>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<'a, S: GraphemeSegmenter> PartialEq<str> for RopeSlice<'a, S>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<'a, S: GraphemeSegmenter> PartialEq<String> for RopeSlice<'a, S>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<'a, 'b, S: GraphemeSegmenter> PartialEq<Cow<'b, str>> for RopeSlice<'a, S>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<'a, S1: GraphemeSegmenter, S2: GraphemeSegmenter> PartialEq<Rope<S2>> for RopeSlice<'a, S1>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.