Struct teleparse::tp::Quote

source ·
pub struct Quote<S, T: Produce>(/* private fields */);
Expand description

Node that stores stringified source code

Implementations§

source§

impl<S, T: Produce> Quote<S, T>

source

pub fn into_inner(self) -> S

Trait Implementations§

source§

impl<S: Clone, T: Clone + Produce> Clone for Quote<S, T>

source§

fn clone(&self) -> Quote<S, T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S: Debug, T: Produce> Debug for Quote<S, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<S, T: Produce> Deref for Quote<S, T>

§

type Target = S

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<S, T: Produce> DerefMut for Quote<S, T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<S, T: Produce> From<Node<S>> for Quote<S, T>

source§

fn from(node: Node<S>) -> Self

Converts to this type from the input type.
source§

impl<S: PartialEq, T: PartialEq + Produce> PartialEq for Quote<S, T>

source§

fn eq(&self, other: &Quote<S, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S, T: Produce> Produce for Quote<S, T>
where S: for<'a> From<&'a str>,

§

type Prod = <T as Produce>::Prod

source§

fn produce( parser: &mut Parser<'_, <Self::Prod as Production>::L>, meta: &Metadata<<Self::Prod as Production>::L>, ) -> SynResult<Self, <Self::Prod as Production>::L>

source§

fn prod_id() -> TypeId

source§

impl<S, T: Produce> ToSpan for Quote<S, T>

source§

fn lo(&self) -> Pos

source§

fn hi(&self) -> Pos

source§

fn span(&self) -> Span

source§

impl<S, T: Produce> StructuralPartialEq for Quote<S, T>

Auto Trait Implementations§

§

impl<S, T> Freeze for Quote<S, T>
where S: Freeze,

§

impl<S, T> RefUnwindSafe for Quote<S, T>

§

impl<S, T> Send for Quote<S, T>
where S: Send, T: Send,

§

impl<S, T> Sync for Quote<S, T>
where S: Sync, T: Sync,

§

impl<S, T> Unpin for Quote<S, T>
where S: Unpin, T: Unpin,

§

impl<S, T> UnwindSafe for Quote<S, T>
where S: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Source for T
where T: Deref, <T as Deref>::Target: Source,

§

type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a> where T: 'a

A type this Source can be sliced into.
source§

fn len(&self) -> usize

Length of the source
source§

fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>
where Chunk: Chunk<'a>,

Read a chunk of bytes into an array. Returns None when reading out of bounds would occur. Read more
source§

unsafe fn read_byte_unchecked(&self, offset: usize) -> u8

Read a byte without doing bounds checks. Read more
source§

fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>

Get a slice of the source at given range. This is analogous to slice::get(range). Read more
source§

unsafe fn slice_unchecked( &self, range: Range<usize>, ) -> <T as Source>::Slice<'_>

Get a slice of the source at given range. This is analogous to slice::get_unchecked(range). Read more
source§

fn is_boundary(&self, index: usize) -> bool

Check if index is valid for this Source, that is: Read more
source§

fn find_boundary(&self, index: usize) -> usize

For &str sources attempts to find the closest char boundary at which source can be sliced, starting from index. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.