Trait moore_common::source::SourceContent [−][src]
pub trait SourceContent { fn iter(&self) -> Box<CharIter<'_>>; fn iter_from(&self, offset: usize) -> Box<CharIter<'_>>; fn extract(&self, begin: usize, end: usize) -> String; fn extract_iter(&self, begin: usize, end: usize) -> Box<CharIter<'_>>; fn bytes(&self) -> &[u8]; }
Required methods
Obtain an iterator over the characters within the source file, together with their respective byte positions.
Obtain an iterator over the characters within the source file, starting
at the provided location offset
, together with their respective byte
positions.
Copy a range of the source content into a String instance owned by the caller, possibly converting the encoding such that the result is in UTF-8.
Obtain an iterator over an extract of the source content. This might be more efficient than copying the extract into a String.