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>
impl<'a> Syntax<'a>
Sourcepub(crate) fn split(atom: &'a str, kind: &str) -> Result<Self, ScopeParseError>
pub(crate) fn split(atom: &'a str, kind: &str) -> Result<Self, ScopeParseError>
Splits atom, whose kind split_kind found to be kind.
Sourcepub(crate) fn list(&mut self, name: &str, positional: bool) -> Vec<String>
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.
Sourcepub(crate) fn single(&mut self, name: &str, positional: bool) -> Option<String>
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=.
Sourcepub(crate) fn warn(&mut self, warning: ScopeWarning)
pub(crate) fn warn(&mut self, warning: ScopeWarning)
Records warning, once.
Sourcepub(crate) fn finish(self) -> Vec<ScopeWarning>
pub(crate) fn finish(self) -> Vec<ScopeWarning>
Ends the read. Each parameter the kind did not take is ignored, with a warning naming it.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more