PunctuatedInner

Struct PunctuatedInner 

Source
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>

Source

pub fn new() -> PunctuatedInner<T, P>

Source

pub fn with_capacity(capacity: usize) -> PunctuatedInner<T, P>

Source

pub fn push_value(&mut self, value: T)

Source

pub fn push_punct(&mut self, punct: P)

Source

pub fn trailing_punct(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn capacity(&self) -> usize

Source

pub fn reserve(&mut self, additional: usize)

Source

pub fn shrink_to_fit(&mut self)

Source

pub fn clear(&mut self)

Source

pub fn iter(&self) -> impl Iterator<Item = &T>

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>

Source

pub fn pairs(&self) -> impl Iterator<Item = (&T, Option<&P>)>

Source

pub fn pairs_mut(&mut self) -> impl Iterator<Item = (&mut T, Option<&mut P>)>

Source

pub fn into_pairs(self) -> impl Iterator<Item = (T, Option<P>)>

Source

pub fn first(&self) -> Option<&T>

Source

pub fn last(&self) -> Option<&T>

Trait Implementations§

Source§

impl<T, P> AsMut<PunctuatedInner<T, P>> for Punctuated<T, P>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

fn as_ref(&self) -> &PunctuatedInner<T, P>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T, P> Clone for PunctuatedInner<T, P>
where T: Clone, P: Clone,

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<T, P> Debug for PunctuatedInner<T, P>
where T: Debug, P: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T, P> Default for PunctuatedInner<T, P>

Source§

fn default() -> PunctuatedInner<T, P>

Returns the “default value” for a type. Read more
Source§

impl<T, P> FromIterator<T> for PunctuatedInner<T, P>

Source§

fn from_iter<I>(iter: I) -> PunctuatedInner<T, P>
where I: IntoIterator<Item = T>,

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>

§

impl<T, P> Send for PunctuatedInner<T, P>
where T: Send, P: Send,

§

impl<T, P> Sync for PunctuatedInner<T, P>
where T: Sync, P: Sync,

§

impl<T, P> Unpin for PunctuatedInner<T, P>
where T: Unpin, P: Unpin,

§

impl<T, P> UnwindSafe for PunctuatedInner<T, P>
where T: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.