Struct svgtypes::StrSpan [−][src]
#[must_use]pub struct StrSpan<'a> { /* fields omitted */ }
An immutable string slice.
Unlike &str contains a reference to the original string
and a span position.
Methods
impl<'a> StrSpan<'a>[src]
impl<'a> StrSpan<'a>pub fn from_substr(text: &str, start: usize, end: usize) -> StrSpan[src]
pub fn from_substr(text: &str, start: usize, end: usize) -> StrSpanConstructs a new StrSpan from substring.
pub fn start(&self) -> usize[src]
pub fn start(&self) -> usizeReturns a start position of the span.
pub fn end(&self) -> usize[src]
pub fn end(&self) -> usizeReturns a end position of the span.
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeReturns a length of the span.
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolReturns a length of the span.
pub fn full_len(&self) -> usize[src]
pub fn full_len(&self) -> usizeReturns a length of the span underling string.
pub fn to_str(&self) -> &'a str[src]
pub fn to_str(&self) -> &'a strReturns a span slice.
A bit expensive, since Rust checks for char boundary.
pub fn as_bytes(&self) -> &'a [u8][src]
pub fn as_bytes(&self) -> &'a [u8]Returns a span slice as bytes.
The same as to_str but does not involve char boundary checking.
pub fn slice_region(&self, start: usize, end: usize) -> StrSpan<'a>[src]
pub fn slice_region(&self, start: usize, end: usize) -> StrSpan<'a>Returns an underling string region as StrSpan.
pub fn full_str(&self) -> &'a str[src]
pub fn full_str(&self) -> &'a strReturns an underling string.
pub fn trim(&self) -> StrSpan<'a>[src]
pub fn trim(&self) -> StrSpan<'a>Returns a trimmed version of this StrSpan.
Removes only leading and trailing spaces.
This function will trim escaped spaces (aka  ) too.
Trait Implementations
impl<'a> Display for StrSpan<'a>[src]
impl<'a> Display for StrSpan<'a>fn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl<'a> Clone for StrSpan<'a>[src]
impl<'a> Clone for StrSpan<'a>fn clone(&self) -> StrSpan<'a>[src]
fn clone(&self) -> StrSpan<'a>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<'a> Debug for StrSpan<'a>[src]
impl<'a> Debug for StrSpan<'a>fn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl<'a> Copy for StrSpan<'a>[src]
impl<'a> Copy for StrSpan<'a>impl<'a> PartialEq<StrSpan<'a>> for StrSpan<'a>[src]
impl<'a> PartialEq<StrSpan<'a>> for StrSpan<'a>fn eq(&self, other: &StrSpan<'a>) -> bool[src]
fn eq(&self, other: &StrSpan<'a>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &StrSpan<'a>) -> bool[src]
fn ne(&self, other: &StrSpan<'a>) -> boolThis method tests for !=.
impl<'a> From<StrSpan<'a>> for Stream<'a>[src]
impl<'a> From<StrSpan<'a>> for Stream<'a>impl<'a> From<StrSpan<'a>> for Tokenizer<'a>[src]
impl<'a> From<StrSpan<'a>> for Tokenizer<'a>ⓘImportant traits for Tokenizer<'a>fn from(span: StrSpan<'a>) -> Tokenizer<'a>[src]
fn from(span: StrSpan<'a>) -> Tokenizer<'a>Performs the conversion.
impl<'a> From<&'a str> for StrSpan<'a>[src]
impl<'a> From<&'a str> for StrSpan<'a>impl<'a> From<StrSpan<'a>> for LengthListParser<'a>[src]
impl<'a> From<StrSpan<'a>> for LengthListParser<'a>impl<'a> From<StrSpan<'a>> for NumberListParser<'a>[src]
impl<'a> From<StrSpan<'a>> for NumberListParser<'a>impl<'a> From<StrSpan<'a>> for PathParser<'a>[src]
impl<'a> From<StrSpan<'a>> for PathParser<'a>impl<'a> From<StrSpan<'a>> for PointsParser<'a>[src]
impl<'a> From<StrSpan<'a>> for PointsParser<'a>impl<'a> From<StrSpan<'a>> for StyleParser<'a>[src]
impl<'a> From<StrSpan<'a>> for StyleParser<'a>impl<'a> From<StrSpan<'a>> for TransformListParser<'a>[src]
impl<'a> From<StrSpan<'a>> for TransformListParser<'a>