[][src]Struct git2::string_array::StringArray

pub struct StringArray { /* fields omitted */ }

A string array structure used by libgit2

Some apis return arrays of strings which originate from libgit2. This wrapper type behaves a little like Vec<&str> but does so without copying the underlying strings until necessary.

Methods

impl StringArray
[src]

pub fn get(&self, i: usize) -> Option<&str>
[src]

Returns None if the i'th string is not utf8 or if i is out of bounds.

pub fn get_bytes(&self, i: usize) -> Option<&[u8]>
[src]

Returns None if i is out of bounds.

Important traits for Iter<'a>
pub fn iter(&self) -> Iter
[src]

Returns an iterator over the strings contained within this array.

The iterator yields Option<&str> as it is unknown whether the contents are utf-8 or not.

Important traits for IterBytes<'a>
pub fn iter_bytes(&self) -> IterBytes
[src]

Returns an iterator over the strings contained within this array, yielding byte slices.

pub fn len(&self) -> usize
[src]

Returns the number of strings in this array.

pub fn is_empty(&self) -> bool
[src]

Return true if this array is empty.

Trait Implementations

impl<'a> IntoIterator for &'a StringArray
[src]

type Item = Option<&'a str>

The type of the elements being iterated over.

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

impl Drop for StringArray
[src]

Auto Trait Implementations

impl !Send for StringArray

impl !Sync for StringArray

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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