pub struct ConstInteger<const V: u128>(/* private fields */);Expand description
A constant u128 integer of value V. Must match V and also has Default implemented to create
a LiteralInteger with value V.
let mut token_iter = "foo".to_token_iter();
let parsed = <OrDefault<u32, ConstInteger<1234>>>::parser(&mut token_iter).unwrap();
assert_tokens_eq!(parsed, "1234");Implementations§
Source§impl<const V: u128> ConstInteger<V>
impl<const V: u128> ConstInteger<V>
Sourcepub fn into_inner(self) -> LiteralInteger
pub fn into_inner(self) -> LiteralInteger
Deconstructs self and gets the LiteralInteger
Trait Implementations§
Source§impl<const V: u128> Clone for ConstInteger<V>
impl<const V: u128> Clone for ConstInteger<V>
Source§fn clone(&self) -> ConstInteger<V>
fn clone(&self) -> ConstInteger<V>
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<const V: u128> Debug for ConstInteger<V>
impl<const V: u128> Debug for ConstInteger<V>
Source§impl<const V: u128> Default for ConstInteger<V>
impl<const V: u128> Default for ConstInteger<V>
Source§impl<const V: u128> Parser for ConstInteger<V>
impl<const V: u128> Parser for ConstInteger<V>
Source§impl<const V: u128> ToTokens for ConstInteger<V>
impl<const V: u128> ToTokens for ConstInteger<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: u128> !Send for ConstInteger<V>
impl<const V: u128> !Sync for ConstInteger<V>
impl<const V: u128> Freeze for ConstInteger<V>
impl<const V: u128> RefUnwindSafe for ConstInteger<V>
impl<const V: u128> Unpin for ConstInteger<V>
impl<const V: u128> UnsafeUnpin for ConstInteger<V>
impl<const V: u128> UnwindSafe for ConstInteger<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>
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