Struct Surrounded

Source
pub struct Surrounded<'source, P, T>
where P: Pair,
{ pub open: P::Open<'source>, pub value: T, pub close: P::Close<'source>, /* private fields */ }
Expand description

Represents a value that is surrounded by two tokens.

Fields§

§open: P::Open<'source>

The opening token that was parsed.

§value: T

The value.

§close: P::Close<'source>

The closing token that was parsed.

Trait Implementations§

Source§

impl<'source, P, T: Clone> Clone for Surrounded<'source, P, T>
where P: Pair + Clone, P::Open<'source>: Clone, P::Close<'source>: Clone,

Source§

fn clone(&self) -> Surrounded<'source, P, T>

Returns a duplicate 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<'source, P, T: Debug> Debug for Surrounded<'source, P, T>
where P: Pair + Debug, P::Open<'source>: Debug, P::Close<'source>: Debug,

Source§

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

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

impl<'source, P, T> Parse<'source> for Surrounded<'source, P, T>
where P: Parse<'source> + Pair, T: Parse<'source>,

Source§

fn std_parse( input: &mut Parser<'source>, recoverable_errors: &mut Vec<Error>, ) -> Result<Self, Vec<Error>>

Parses a value from the given stream of tokens, advancing the stream past the consumed tokens if parsing is successful. Read more
Source§

fn parse(input: &mut Parser<'source>) -> ParseResult<Self>

Parses a value from the given stream of tokens, advancing the stream past the consumed tokens if parsing is successful. Read more
Source§

impl<'source, P, T: PartialEq> PartialEq for Surrounded<'source, P, T>
where P: Pair + PartialEq, P::Open<'source>: PartialEq, P::Close<'source>: PartialEq,

Source§

fn eq(&self, other: &Surrounded<'source, P, 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<'source, P, T: Eq> Eq for Surrounded<'source, P, T>
where P: Pair + Eq, P::Open<'source>: Eq, P::Close<'source>: Eq,

Source§

impl<'source, P, T> StructuralPartialEq for Surrounded<'source, P, T>
where P: Pair,

Auto Trait Implementations§

§

impl<'source, P, T> Freeze for Surrounded<'source, P, T>
where <P as Pair>::Open<'source>: Freeze, T: Freeze, <P as Pair>::Close<'source>: Freeze,

§

impl<'source, P, T> RefUnwindSafe for Surrounded<'source, P, T>
where <P as Pair>::Open<'source>: RefUnwindSafe, T: RefUnwindSafe, <P as Pair>::Close<'source>: RefUnwindSafe, P: RefUnwindSafe,

§

impl<'source, P, T> Send for Surrounded<'source, P, T>
where <P as Pair>::Open<'source>: Send, T: Send, <P as Pair>::Close<'source>: Send, P: Send,

§

impl<'source, P, T> Sync for Surrounded<'source, P, T>
where <P as Pair>::Open<'source>: Sync, T: Sync, <P as Pair>::Close<'source>: Sync, P: Sync,

§

impl<'source, P, T> Unpin for Surrounded<'source, P, T>
where <P as Pair>::Open<'source>: Unpin, T: Unpin, <P as Pair>::Close<'source>: Unpin, P: Unpin,

§

impl<'source, P, T> UnwindSafe for Surrounded<'source, P, T>
where <P as Pair>::Open<'source>: UnwindSafe, T: UnwindSafe, <P as Pair>::Close<'source>: UnwindSafe, P: 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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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>,

Source§

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>,

Source§

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.