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]
pub fn chars(&'a self) -> Box<Iterator<Item = char> + 'a>[src]
pub fn char_indices(&'a self) -> Box<Iterator<Item = (usize, char)> + 'a>[src]
pub fn bytes(&'a self) -> Box<Iterator<Item = u8> + 'a>[src]
pub fn split_whitespace(&'a self) -> Box<Iterator<Item = &'a str> + 'a>[src]
pub fn new(node: &'a Node, range: Range<usize>) -> Self[src]
pub fn len(&self) -> usize[src]
pub fn is_empty(&self) -> bool[src]
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]
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
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[src]
A rope equals another rope if all the bytes in both are equal.
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'a> PartialEq<str> for RopeSlice<'a>[src]
fn eq(&self, other: &str) -> bool[src]
A rope equals another rope if all the bytes in both are equal.
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'a> PartialEq<&'a str> for RopeSlice<'a>[src]
fn eq(&self, other: &&'a str) -> bool[src]
A rope equals another rope if all the bytes in both are equal.
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.