pub struct PunctuatedInner<T, P> { /* private fields */ }Expand description
Internal storage for punctuated sequences.
Stores pairs of values and optional punctuation. This is the shared
implementation used by Punctuated, Terminated, and Separated.
Implementations§
Source§impl<T, P> PunctuatedInner<T, P>
impl<T, P> PunctuatedInner<T, P>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn push_value(&mut self, value: T)
pub fn push_punct(&mut self, punct: P)
pub fn trailing_punct(&self) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> usize
pub fn reserve(&mut self, additional: usize)
pub fn shrink_to_fit(&mut self)
pub fn clear(&mut self)
pub fn iter(&self) -> impl Iterator<Item = &T>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>
pub fn pairs(&self) -> impl Iterator<Item = (&T, Option<&P>)>
pub fn pairs_mut(&mut self) -> impl Iterator<Item = (&mut T, Option<&mut P>)>
pub fn into_pairs(self) -> impl Iterator<Item = (T, Option<P>)>
pub fn first(&self) -> Option<&T>
pub fn last(&self) -> Option<&T>
Trait Implementations§
Source§impl<T, P> AsMut<PunctuatedInner<T, P>> for Punctuated<T, P>
impl<T, P> AsMut<PunctuatedInner<T, P>> for Punctuated<T, P>
Source§fn as_mut(&mut self) -> &mut PunctuatedInner<T, P>
fn as_mut(&mut self) -> &mut PunctuatedInner<T, P>
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<T, P> AsMut<PunctuatedInner<T, P>> for Separated<T, P>
impl<T, P> AsMut<PunctuatedInner<T, P>> for Separated<T, P>
Source§fn as_mut(&mut self) -> &mut PunctuatedInner<T, P>
fn as_mut(&mut self) -> &mut PunctuatedInner<T, P>
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<T, P> AsMut<PunctuatedInner<T, P>> for Terminated<T, P>
impl<T, P> AsMut<PunctuatedInner<T, P>> for Terminated<T, P>
Source§fn as_mut(&mut self) -> &mut PunctuatedInner<T, P>
fn as_mut(&mut self) -> &mut PunctuatedInner<T, P>
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<T, P> AsRef<PunctuatedInner<T, P>> for Punctuated<T, P>
impl<T, P> AsRef<PunctuatedInner<T, P>> for Punctuated<T, P>
Source§fn as_ref(&self) -> &PunctuatedInner<T, P>
fn as_ref(&self) -> &PunctuatedInner<T, P>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<T, P> AsRef<PunctuatedInner<T, P>> for Separated<T, P>
impl<T, P> AsRef<PunctuatedInner<T, P>> for Separated<T, P>
Source§fn as_ref(&self) -> &PunctuatedInner<T, P>
fn as_ref(&self) -> &PunctuatedInner<T, P>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<T, P> AsRef<PunctuatedInner<T, P>> for Terminated<T, P>
impl<T, P> AsRef<PunctuatedInner<T, P>> for Terminated<T, P>
Source§fn as_ref(&self) -> &PunctuatedInner<T, P>
fn as_ref(&self) -> &PunctuatedInner<T, P>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<T: Clone, P: Clone> Clone for PunctuatedInner<T, P>
impl<T: Clone, P: Clone> Clone for PunctuatedInner<T, P>
Source§fn clone(&self) -> PunctuatedInner<T, P>
fn clone(&self) -> PunctuatedInner<T, P>
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, P> Default for PunctuatedInner<T, P>
impl<T, P> Default for PunctuatedInner<T, P>
Source§impl<T, P> FromIterator<T> for PunctuatedInner<T, P>
impl<T, P> FromIterator<T> for PunctuatedInner<T, P>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<T, P> Freeze for PunctuatedInner<T, P>
impl<T, P> RefUnwindSafe for PunctuatedInner<T, P>where
T: RefUnwindSafe,
P: RefUnwindSafe,
impl<T, P> Send for PunctuatedInner<T, P>
impl<T, P> Sync for PunctuatedInner<T, P>
impl<T, P> Unpin for PunctuatedInner<T, P>
impl<T, P> UnwindSafe for PunctuatedInner<T, P>where
T: UnwindSafe,
P: 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