[][src]Struct lark_string::Text

pub struct Text { /* fields omitted */ }

A "Text" is like a string except that it can be cheaply cloned. You can also "extract" subtexts quite cheaply. You can also deref an &Text into a &str for interoperability.

Used to represent the value of an input file.

Methods

impl Text[src]

pub fn select(&mut self, range: Range<usize>)[src]

Modifies this restrict to a subset of its current range.

pub fn extract(&self, range: Range<usize>) -> Self[src]

Extract a new Text that is a subset of an old Text -- text.extract(1..3) is similar to &foo[1..3] except that it gives back an owned value instead of a borrowed value.

Trait Implementations

impl Eq for Text[src]

impl Clone for Text[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq<Text> for Text[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl PartialEq<str> for Text[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl PartialEq<String> for Text[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl PartialEq<Text> for str[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl PartialEq<Text> for String[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<T: ?Sized, '_> PartialEq<&'_ T> for Text where
    Text: PartialEq<T>, 
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl AsRef<str> for Text[src]

impl From<Arc<String>> for Text[src]

impl From<String> for Text[src]

impl<'_> From<&'_ String> for Text[src]

impl<'_> From<&'_ str> for Text[src]

impl Deref for Text[src]

type Target = str

The resulting type after dereferencing.

impl Hash for Text[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Text[src]

impl Display for Text[src]

impl Borrow<str> for Text[src]

impl DebugWith for Text[src]

fn debug_with<Cx>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, &'me Self, Cx> where
    Cx: ?Sized
[src]

fn into_debug_with<Cx>(self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> where
    Cx: ?Sized
[src]

impl Intern<GlobalIdentifierTables> for Text

impl InternDirect<GlobalIdentifierTables> for Text

Auto Trait Implementations

impl Send for Text

impl Sync for Text

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<Cx, T> FmtWithSpecialized for T where
    Cx: ?Sized,
    T: Debug + ?Sized
[src]

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T