pub struct Splat<T>(pub T);
Expand description
If input is of the syntax [v; N]
,
rewrite the input into [v, v, .. v,]
(N times)
Example
let Splat(Stringify(value)) = quote!([4; 3]).into_iter().extract().unwrap();
assert_eq!(value, "[4 , 4 , 4 ,]");
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T: FromMacro> FromMacro for Splat<T>
impl<T: FromMacro> FromMacro for Splat<T>
source§impl<T: PartialEq> PartialEq for Splat<T>
impl<T: PartialEq> PartialEq for Splat<T>
source§impl<T> ToTokens for Splat<T>where
T: ToTokens,
impl<T> ToTokens for Splat<T>where
T: ToTokens,
source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl<T: Copy> Copy for Splat<T>
impl<T: Eq> Eq for Splat<T>
impl<T> StructuralEq for Splat<T>
impl<T> StructuralPartialEq for Splat<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Splat<T>where
T: RefUnwindSafe,
impl<T> Send for Splat<T>where
T: Send,
impl<T> Sync for Splat<T>where
T: Sync,
impl<T> Unpin for Splat<T>where
T: Unpin,
impl<T> UnwindSafe for Splat<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