Struct parse_js::source::SourceRange
source · Expand description
A string backed by a source. Treated as a string, so contents rather than position is considered the value. For example, two SourceRange values are equal if their contents equal, even if they are from different files or positions in the same file.
Fields
source: Source
start: usize
end: usize
Implementations
sourceimpl SourceRange
impl SourceRange
pub fn add_option(&self, rhs: Option<&SourceRange>) -> SourceRange
pub fn anonymous<T: Into<Vec<u8>>>(code: T) -> SourceRange
pub fn is_empty(&self) -> bool
pub fn is_eof(&self) -> bool
pub fn as_slice(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
pub fn as_str(&self) -> &str
pub fn len(&self) -> usize
pub fn extend(&mut self, other: &SourceRange)
Trait Implementations
sourceimpl Add<&SourceRange> for &SourceRange
impl Add<&SourceRange> for &SourceRange
sourceimpl AddAssign<SourceRange> for SourceRange
impl AddAssign<SourceRange> for SourceRange
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresourceimpl Clone for SourceRange
impl Clone for SourceRange
sourcefn clone(&self) -> SourceRange
fn clone(&self) -> SourceRange
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for SourceRange
impl Debug for SourceRange
sourceimpl Hash for SourceRange
impl Hash for SourceRange
sourceimpl Index<SourceRange> for Lexer
impl Index<SourceRange> for Lexer
sourceimpl PartialEq<SourceRange> for SourceRange
impl PartialEq<SourceRange> for SourceRange
impl Eq for SourceRange
Auto Trait Implementations
impl RefUnwindSafe for SourceRange
impl !Send for SourceRange
impl !Sync for SourceRange
impl Unpin for SourceRange
impl UnwindSafe for SourceRange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more