pub struct Index { /* private fields */ }Expand description
An Index struct holds information about source positions.
Implementations§
Source§impl Index
impl Index
Sourcepub fn bytes<'a>(&self, source: &'a str) -> &'a [u8] ⓘ
pub fn bytes<'a>(&self, source: &'a str) -> &'a [u8] ⓘ
Returns the bytes of the index from the source.
Sourcepub fn str<'a>(&self, source: &'a str) -> &'a str
pub fn str<'a>(&self, source: &'a str) -> &'a str
Returns the str of the index from the source.
§Safety
This method does not check the validity of UTF-8 boundaries.
Sourcepub fn with_start(&self, v: usize) -> Index
pub fn with_start(&self, v: usize) -> Index
Returns a new Index with same value except stop.
Trait Implementations§
impl Copy for Index
impl Eq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl UnwindSafe for Index
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