Enum Pair
enum Pair<T, P>
A single syntax tree node of type T followed by its trailing punctuation
of type P if any.
Refer to the module documentation for details about punctuated sequences.
Variants
-
Punctuated(T, P) -
End(T)
Implementations
impl<T, P> Pair<&T, &P>
fn cloned(self: Self) -> Pair<T, P> where T: Clone, P: Clone
impl<T, P> Pair<T, P>
fn into_value(self: Self) -> TExtracts the syntax tree node from this punctuated pair, discarding the following punctuation.
fn value(self: &Self) -> &TBorrows the syntax tree node from this punctuated pair.
fn value_mut(self: &mut Self) -> &mut TMutably borrows the syntax tree node from this punctuated pair.
fn punct(self: &Self) -> Option<&P>Borrows the punctuation from this punctuated pair, unless this pair is the final one and there is no trailing punctuation.
fn punct_mut(self: &mut Self) -> Option<&mut P>Mutably borrows the punctuation from this punctuated pair, unless the pair is the final one and there is no trailing punctuation.
Example
# use Span; # use Punctuated; # use ; # # let mut punctuated = >new; # let span = call_site; # punctuated.insert; if let Some = punctuated.pairs_mut.next.unwrap.punct_mutfn new(t: T, p: Option<P>) -> SelfCreates a punctuated pair out of a syntax tree node and an optional following punctuation.
fn into_tuple(self: Self) -> (T, Option<P>)Produces this punctuated pair as a tuple of syntax tree node and optional following punctuation.
impl<T> Any for Pair<T, P>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Pair<T, P>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Pair<T, P>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Pair<T, P>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Pair<T, P>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Spanned for Pair<T, P>
fn span(self: &Self) -> Span
impl<T> ToOwned for Pair<T, P>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, P> Clone for Pair<T, P>
fn clone(self: &Self) -> Self
impl<T, P> Copy for Pair<T, P>
impl<T, P> Freeze for Pair<T, P>
impl<T, P> RefUnwindSafe for Pair<T, P>
impl<T, P> Send for Pair<T, P>
impl<T, P> Sync for Pair<T, P>
impl<T, P> ToTokens for crate::punctuated::Pair<T, P>
fn to_tokens(self: &Self, tokens: &mut TokenStream)
impl<T, P> Unpin for Pair<T, P>
impl<T, P> UnwindSafe for Pair<T, P>
impl<T, U> Into for Pair<T, P>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Pair<T, P>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Pair<T, P>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>