pub struct ConstCharacter<const V: char>(/* private fields */);Expand description
A constant char of value V. Must match V and also has Default implemented to create
a LiteralCharacter with value V.
let mut token_iter = "'f'".to_token_iter();
let parsed = <OrDefault<u32, ConstCharacter<'f'>>>::parser(&mut token_iter).unwrap();
assert_tokens_eq!(parsed, "'f'");Implementations§
Source§impl<const V: char> ConstCharacter<V>
impl<const V: char> ConstCharacter<V>
Sourcepub fn into_inner(self) -> LiteralCharacter
pub fn into_inner(self) -> LiteralCharacter
Deconstructs self and gets the Literal
Trait Implementations§
Source§impl<const V: char> Clone for ConstCharacter<V>
impl<const V: char> Clone for ConstCharacter<V>
Source§fn clone(&self) -> ConstCharacter<V>
fn clone(&self) -> ConstCharacter<V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const V: char> Debug for ConstCharacter<V>
impl<const V: char> Debug for ConstCharacter<V>
Source§impl<const V: char> Default for ConstCharacter<V>
impl<const V: char> Default for ConstCharacter<V>
Source§fn default() -> ConstCharacter<V>
fn default() -> ConstCharacter<V>
Returns the “default value” for a type. Read more
Source§impl<const V: char> Parser for ConstCharacter<V>
impl<const V: char> Parser for ConstCharacter<V>
Source§fn parser(tokens: &mut TokenIter) -> Result<ConstCharacter<V>, Error>
fn parser(tokens: &mut TokenIter) -> Result<ConstCharacter<V>, Error>
The actual parsing function that must be implemented. This mutates the
tokens
iterator directly. It should not be called from user code except for implementing
parsers itself and then only when the rules below are followed. Read moreSource§impl<const V: char> ToTokens for ConstCharacter<V>
impl<const V: char> ToTokens for ConstCharacter<V>
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn into_token_iter(self) -> TokenIter ⓘwhere
Self: Sized,
fn into_token_iter(self) -> TokenIter ⓘwhere
Self: Sized,
Convert
self into a TokenIter object.Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Convert
&self into a TokenStream object.Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Convert
self into a TokenStream object.Auto Trait Implementations§
impl<const V: char> Freeze for ConstCharacter<V>
impl<const V: char> RefUnwindSafe for ConstCharacter<V>
impl<const V: char> !Send for ConstCharacter<V>
impl<const V: char> !Sync for ConstCharacter<V>
impl<const V: char> Unpin for ConstCharacter<V>
impl<const V: char> UnwindSafe for ConstCharacter<V>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynamicTokens for T
impl<T> DynamicTokens for T
Source§impl<T> Parse for Twhere
T: Parser,
impl<T> Parse for Twhere
T: Parser,
Source§fn parse(tokens: &mut TokenIter) -> Result<Self, Error>
fn parse(tokens: &mut TokenIter) -> Result<Self, Error>
This is the user facing API to parse grammatical entities. Calls a
parser() within a
transaction. Commits changes on success and returns the parsed value. Read more