pub struct HiddenState<T: Default>(pub T);Expand description
Sometimes one want to compose types or create structures for unsynn that have members that
are not part of the parsed syntax but add some additional information. This struct can be
used to hold such members while still using the Parser and ToTokens trait
implementations automatically generated by the unsynn!{} macro or composition syntax.
HiddenState will not consume any tokens when parsing and will not emit any tokens when
generating a TokenStream. On parsing it is initialized with a default value. It has
Deref and DerefMut implemented to access the inner value.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T: Clone + Default> Clone for HiddenState<T>
impl<T: Clone + Default> Clone for HiddenState<T>
Source§fn clone(&self) -> HiddenState<T>
fn clone(&self) -> HiddenState<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Default> Default for HiddenState<T>
impl<T: Default> Default for HiddenState<T>
Source§impl<T: Default> Deref for HiddenState<T>
impl<T: Default> Deref for HiddenState<T>
Source§impl<T: Default> DerefMut for HiddenState<T>
impl<T: Default> DerefMut for HiddenState<T>
Source§impl<T: Default> Parser for HiddenState<T>
impl<T: Default> Parser for HiddenState<T>
Source§impl<T: Default> ToTokens for HiddenState<T>
impl<T: Default> ToTokens for HiddenState<T>
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<T> Freeze for HiddenState<T>where
T: Freeze,
impl<T> RefUnwindSafe for HiddenState<T>where
T: RefUnwindSafe,
impl<T> Send for HiddenState<T>where
T: Send,
impl<T> Sync for HiddenState<T>where
T: Sync,
impl<T> Unpin for HiddenState<T>where
T: Unpin,
impl<T> UnsafeUnpin for HiddenState<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for HiddenState<T>where
T: UnwindSafe,
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>
fn parse(tokens: &mut TokenIter) -> Result<Self>
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