Struct PU

Source
pub struct PU<P> { /* private fields */ }
Expand description

a type which implemented ParseUnit<S> with source code it selected

Implementations§

Source§

impl<P> PU<P>

Source

pub const fn new(span: Span, item: P) -> Self

Source

pub fn take(self) -> P

Source

pub fn map<P1, M>(self, mapper: M) -> PU<P1>
where M: FnOnce(P) -> P1,

Trait Implementations§

Source§

impl<P> Clone for PU<P>
where P: Clone,

Source§

fn clone(&self) -> Self

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<P> Debug for PU<P>
where P: Debug,

Source§

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

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

impl<P> Deref for PU<P>

Source§

type Target = P

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<P> DerefMut for PU<P>

Source§

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

Mutably dereferences the value.
Source§

impl<P> Display for PU<P>
where P: Display,

Source§

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

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

impl<S, P> ParseUnit<S> for PU<P>
where P: ParseUnit<S>, S: Source,

Source§

type Target = PU<<P as ParseUnit<S>>::Target>

the type of the parse result
Source§

fn parse(p: &mut Parser<S>) -> Result<Self::Target, ParseError>

you should not call ParseUnit::parse directly, using methods like Parser::once instead
Source§

impl<P> WithSpan for PU<P>

Source§

fn get_span(&self) -> Span

get the location information
Source§

fn make_error(&self, reason: impl ToString) -> Error

make an Error at location
Source§

fn make_message(&self, reason: impl ToString) -> Message

make an Message at location
Source§

impl<P> Copy for PU<P>
where P: Copy,

Auto Trait Implementations§

§

impl<P> Freeze for PU<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for PU<P>
where P: RefUnwindSafe,

§

impl<P> Send for PU<P>
where P: Send,

§

impl<P> Sync for PU<P>
where P: Sync,

§

impl<P> Unpin for PU<P>
where P: Unpin,

§

impl<P> UnwindSafe for PU<P>
where 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<W> WithSpanExt for W
where W: WithSpan,

Source§

fn make_parse_error( &self, reason: impl ToString, kind: ParseErrorKind, ) -> ParseError

make an ParseError at location with ordered ParseErrorKind
Source§

fn unmatch<T>(&self, reason: impl ToString) -> Result<T, ParseError>

make an Unmatched ParseError in Result
Source§

fn throw<T>(&self, reason: impl ToString) -> Result<T, ParseError>

make an Semantic ParseError in Result