Struct git2::string_array::StringArray [−][src]
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]
impl StringArray
pub fn get(&self, i: usize) -> Option<&str>
[src]
pub fn get(&self, i: usize) -> Option<&str>
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]
pub fn get_bytes(&self, i: usize) -> Option<&[u8]>
Returns None if i
is out of bounds.
ⓘImportant traits for Iter<'a>pub fn iter(&self) -> Iter
[src]
pub fn iter(&self) -> Iter
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]
pub fn iter_bytes(&self) -> IterBytes
Returns an iterator over the strings contained within this array, yielding byte slices.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of strings in this array.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Return true
if this array is empty.
Trait Implementations
impl<'a> IntoIterator for &'a StringArray
[src]
impl<'a> IntoIterator for &'a StringArray
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?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl Drop for StringArray
[src]
impl Drop for StringArray
Auto Trait Implementations
impl !Send for StringArray
impl !Send for StringArray
impl !Sync for StringArray
impl !Sync for StringArray