Struct an_rope::RopeSlice
[−]
[src]
pub struct RopeSlice<'a> { /* fields omitted */ }
An immutable borrowed slice of a Rope
.
A RopeSlice
represents an immutable borrowed slice of some or all the
characters in a Rope
.
Methods
impl<'a> RopeSlice<'a>
[src]
fn chars(&'a self) -> Box<Iterator<Item=char> + 'a>
fn char_indices(&'a self) -> Box<Iterator<Item=(usize, char)> + 'a>
fn bytes(&'a self) -> Box<Iterator<Item=u8> + 'a>
fn split_whitespace(&'a self) -> Box<Iterator<Item=&'a str> + 'a>
fn new(node: &'a Node, range: Range<usize>) -> Self
fn len(&self) -> usize
fn is_empty(&self) -> bool
Returns true
if this RopeSlice
is empty.
Examples
A RopeSlice
into an empty rope should be empty:
use an_rope::Rope; let an_empty_rope = Rope::new(); assert!(an_empty_rope.slice(0..0).is_empty());
A RopeSlice
that contains no characters should be empty,
even fi the sliced Rope
is not empty:
use an_rope::Rope; let an_rope = Rope::from("a string that is not empty"); assert!(an_rope.slice(0..0).is_empty());
A RopeSlice
with characters should not be empty:
use an_rope::Rope; let an_rope = Rope::from("a string"); assert!(!an_rope.slice(0..5).is_empty());
Trait Implementations
impl<'a> Display for RopeSlice<'a>
[src]
impl<'a> Debug for RopeSlice<'a>
[src]
impl<'a> Eq for RopeSlice<'a>
[src]
impl<'a> PartialEq for RopeSlice<'a>
[src]
fn eq(&self, other: &RopeSlice<'a>) -> bool
A rope equals another rope if all the bytes in both are equal.
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<'a> PartialEq<str> for RopeSlice<'a>
[src]
fn eq(&self, other: &str) -> bool
A rope equals another rope if all the bytes in both are equal.
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<'a> PartialEq<&'a str> for RopeSlice<'a>
[src]
fn eq(&self, other: &&'a str) -> bool
A rope equals another rope if all the bytes in both are equal.
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.