Enum graphviz::maybe_owned_vec::MaybeOwnedVector[src]

pub enum MaybeOwnedVector<'a, T> {
    Growable(Vec<T>),
    Borrowed(&'a [T]),
}

MaybeOwnedVector<'a,T> abstracts over Vec<T>, &'a [T].

Some clients will have a pre-allocated vector ready to hand off in a slice; others will want to create the set on the fly and hand off ownership, via Growable.

Variants

Growable
Borrowed

Methods

impl<'a, T> MaybeOwnedVector<'a, T>

fn iter(&'a self) -> Items<'a, T>

impl<'a, T: Clone> MaybeOwnedVector<'a, T>

fn into_vec(self) -> Vec<T>

Convert self into a growable Vec, not making a copy if possible.

Trait Implementations

impl<'b, T> Vector<T> for MaybeOwnedVector<'b, T>

fn as_slice<'a>(&'a self) -> &'a [T]

impl<'a, T> FromIterator<T> for MaybeOwnedVector<'a, T>

fn from_iter<I: Iterator<T>>(iterator: I) -> MaybeOwnedVector<T>

impl<'a, T: Show> Show for MaybeOwnedVector<'a, T>

fn fmt(&self, f: &mut Formatter) -> Result

impl<'a, T: Clone> CloneableVector<T> for MaybeOwnedVector<'a, T>

fn to_owned(&self) -> Vec<T>

Returns a copy of self.

fn into_owned(self) -> Vec<T>

Convert self into an owned slice, not making a copy if possible.