Struct git2::string_array::StringArray
source · [−]pub struct StringArray { /* private fields */ }
Expand description
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.
Implementations
sourceimpl StringArray
impl StringArray
sourcepub fn get(&self, i: usize) -> Option<&str>
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.
sourcepub fn iter(&self) -> Iter<'_>ⓘNotable traits for Iter<'a>impl<'a> Iterator for Iter<'a> type Item = Option<&'a str>;
pub fn iter(&self) -> Iter<'_>ⓘNotable traits for Iter<'a>impl<'a> Iterator for Iter<'a> type Item = Option<&'a str>;
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.
Trait Implementations
sourceimpl Drop for StringArray
impl Drop for StringArray
Auto Trait Implementations
impl RefUnwindSafe for StringArray
impl !Send for StringArray
impl !Sync for StringArray
impl Unpin for StringArray
impl UnwindSafe for StringArray
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more