pub struct ArrayRepeat<T>(pub T, pub usize);
Expand description
Extractor for syntax [T; N]
§Example
let ArrayRepeat::<String>(arr, len) = quote!(["foo"; 4]).into_iter().extract().unwrap();
assert_eq!(arr, "foo");
assert_eq!(len, 4);
Tuple Fields§
§0: T
§1: usize
Trait Implementations§
Source§impl<T: Clone> Clone for ArrayRepeat<T>
impl<T: Clone> Clone for ArrayRepeat<T>
Source§fn clone(&self) -> ArrayRepeat<T>
fn clone(&self) -> ArrayRepeat<T>
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<T: Debug> Debug for ArrayRepeat<T>
impl<T: Debug> Debug for ArrayRepeat<T>
Source§impl<T: Default> Default for ArrayRepeat<T>
impl<T: Default> Default for ArrayRepeat<T>
Source§fn default() -> ArrayRepeat<T>
fn default() -> ArrayRepeat<T>
Returns the “default value” for a type. Read more
Source§impl<T: FromMacro> FromMacro for ArrayRepeat<T>
impl<T: FromMacro> FromMacro for ArrayRepeat<T>
Source§impl<T: Hash> Hash for ArrayRepeat<T>
impl<T: Hash> Hash for ArrayRepeat<T>
Source§impl<T: PartialEq> PartialEq for ArrayRepeat<T>
impl<T: PartialEq> PartialEq for ArrayRepeat<T>
Source§impl<T> ToTokens for ArrayRepeat<T>where
T: ToTokens,
impl<T> ToTokens for ArrayRepeat<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 ArrayRepeat<T>
impl<T: Eq> Eq for ArrayRepeat<T>
impl<T> StructuralPartialEq for ArrayRepeat<T>
Auto Trait Implementations§
impl<T> Freeze for ArrayRepeat<T>where
T: Freeze,
impl<T> RefUnwindSafe for ArrayRepeat<T>where
T: RefUnwindSafe,
impl<T> Send for ArrayRepeat<T>where
T: Send,
impl<T> Sync for ArrayRepeat<T>where
T: Sync,
impl<T> Unpin for ArrayRepeat<T>where
T: Unpin,
impl<T> UnwindSafe for ArrayRepeat<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