Skip to main content

Syntax

Struct Syntax 

Source
pub(crate) struct Syntax<'a> {
    positional: Option<String>,
    params: Vec<(&'a str, String)>,
    warnings: Vec<ScopeWarning>,
}
Expand description

One atom’s positional part and name=value parameters, every value percent-decoded, and the warnings reading them has raised so far.

A kind takes the parameters it reads, and Syntax::finish ignores whatever is left. An empty positional part, as in identity:?attr=handle, gives no value.

Fields§

§positional: Option<String>§params: Vec<(&'a str, String)>§warnings: Vec<ScopeWarning>

Implementations§

Source§

impl<'a> Syntax<'a>

Source

pub(crate) fn split(atom: &'a str, kind: &str) -> Result<Self, ScopeParseError>

Splits atom, whose kind split_kind found to be kind.

Source

pub(crate) fn list(&mut self, name: &str, positional: bool) -> Vec<String>

Every value of the list parameter name: the positional part when name is its kind’s positional parameter, then each name= in order.

Source

pub(crate) fn single(&mut self, name: &str, positional: bool) -> Option<String>

The parameter name, which takes one value: the positional part when name is its kind’s positional parameter, or its name=.

Source

pub(crate) fn warn(&mut self, warning: ScopeWarning)

Records warning, once.

Source

pub(crate) fn finish(self) -> Vec<ScopeWarning>

Ends the read. Each parameter the kind did not take is ignored, with a warning naming it.

Source

fn take(&mut self, name: &str) -> Vec<String>

Takes every name= value out of the parameters, in order.

Auto Trait Implementations§

§

impl<'a> Freeze for Syntax<'a>

§

impl<'a> RefUnwindSafe for Syntax<'a>

§

impl<'a> Send for Syntax<'a>

§

impl<'a> Sync for Syntax<'a>

§

impl<'a> Unpin for Syntax<'a>

§

impl<'a> UnsafeUnpin for Syntax<'a>

§

impl<'a> UnwindSafe for Syntax<'a>

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