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§
source§impl 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] ⓘ
pub fn as_str(&self) -> &str
pub fn len(&self) -> usize
pub fn extend(&mut self, other: &SourceRange)
Trait Implementations§
source§impl Add<&SourceRange> for &SourceRange
impl Add<&SourceRange> for &SourceRange
source§impl AddAssign<SourceRange> for SourceRange
impl AddAssign<SourceRange> for SourceRange
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl Clone for SourceRange
impl Clone for SourceRange
source§fn clone(&self) -> SourceRange
fn clone(&self) -> SourceRange
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more