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§
Source§impl StringArray
impl StringArray
Sourcepub fn get(&self, i: usize) -> Result<Option<&str>, Error>
pub fn get(&self, i: usize) -> Result<Option<&str>, Error>
Returns Ok(None) if i is out of bounds.
Sourcepub fn iter(&self) -> Iter<'_> ⓘ
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.
Sourcepub fn iter_bytes(&self) -> IterBytes<'_> ⓘ
pub fn iter_bytes(&self) -> IterBytes<'_> ⓘ
Returns an iterator over the strings contained within this array, yielding byte slices.
Trait Implementations§
Source§impl Binding for StringArray
impl Binding for StringArray
Source§type Raw = git_strarray
type Raw = git_strarray
The raw type that allows you to interact with libgit2-sys.
Source§unsafe fn from_raw(raw: git_strarray) -> StringArray
unsafe fn from_raw(raw: git_strarray) -> StringArray
Build a git2 struct from its Binding::Raw value.
Source§fn raw(&self) -> git_strarray
fn raw(&self) -> git_strarray
Access the Binding::Raw value for a struct. Read more
Source§unsafe fn from_raw_opt<T>(raw: T) -> Option<Self>
unsafe fn from_raw_opt<T>(raw: T) -> Option<Self>
A null-handling version of Binding::from_raw. Read more
Source§impl Drop for StringArray
impl Drop for StringArray
Source§impl<'a> IntoIterator for &'a StringArray
impl<'a> IntoIterator for &'a StringArray
Auto Trait Implementations§
impl Freeze for StringArray
impl RefUnwindSafe for StringArray
impl !Send for StringArray
impl !Sync for StringArray
impl Unpin for StringArray
impl UnsafeUnpin for StringArray
impl UnwindSafe for StringArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more