[][src]Struct glsl::syntax::NonEmpty

pub struct NonEmpty<T>(pub Vec<T>);

A non-empty Vec. It has at least one element.

Methods

impl<T> NonEmpty<T>[src]

pub fn from_non_empty_iter<I>(iter: I) -> Option<Self> where
    I: IntoIterator<Item = T>, 
[src]

Construct a non-empty from an iterator.

Errors

None if the iterator yields no value.

pub fn push(&mut self, item: T)[src]

Move a new item at the end of the non-empty.

pub fn pop(&mut self) -> Option<T>[src]

Move out the last element of the non-empty.

Errors

This function returns None if called on a non-empty that contains a single element.

Trait Implementations

impl<T> Extend<T> for NonEmpty<T>[src]

impl<T> IntoIterator for NonEmpty<T>[src]

type IntoIter = <Vec<T> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

type Item = T

The type of the elements being iterated over.

impl<'a, T> IntoIterator for &'a NonEmpty<T>[src]

type IntoIter = <&'a Vec<T> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

type Item = &'a T

The type of the elements being iterated over.

impl<'a, T> IntoIterator for &'a mut NonEmpty<T>[src]

type IntoIter = <&'a mut Vec<T> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

type Item = &'a mut T

The type of the elements being iterated over.

impl<T: Clone> Clone for NonEmpty<T>[src]

impl<T: PartialEq> PartialEq<NonEmpty<T>> for NonEmpty<T>[src]

impl<T: Debug> Debug for NonEmpty<T>[src]

impl<T> StructuralPartialEq for NonEmpty<T>[src]

Auto Trait Implementations

impl<T> Send for NonEmpty<T> where
    T: Send

impl<T> Sync for NonEmpty<T> where
    T: Sync

impl<T> Unpin for NonEmpty<T> where
    T: Unpin

impl<T> UnwindSafe for NonEmpty<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for NonEmpty<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]