pub struct DirentHash<'a> { /* private fields */ }Expand description
A safe wrapper for APR hashes containing path -> svn_dirent_t mappings
This wrapper encapsulates the common pattern of working with directory entry hashes from Subversion’s C API, reducing unsafe code and providing convenient conversion methods.
Implementations§
Source§impl<'a> DirentHash<'a>
impl<'a> DirentHash<'a>
Sourcepub unsafe fn from_ptr(ptr: *mut apr_hash_t) -> Self
pub unsafe fn from_ptr(ptr: *mut apr_hash_t) -> Self
Create a DirentHash from a raw APR hash pointer
§Safety
The caller must ensure that:
ptris a valid APR hash containing svn_dirent_t values- The hash and its contents remain valid for the lifetime of this wrapper
Sourcepub fn to_hashmap(&self) -> HashMap<String, DirEntry>
pub fn to_hashmap(&self) -> HashMap<String, DirEntry>
Convert the dirents to a HashMap<String, crate::Dirent>
Auto Trait Implementations§
impl<'a> Freeze for DirentHash<'a>
impl<'a> RefUnwindSafe for DirentHash<'a>
impl<'a> !Send for DirentHash<'a>
impl<'a> !Sync for DirentHash<'a>
impl<'a> Unpin for DirentHash<'a>
impl<'a> UnsafeUnpin for DirentHash<'a>
impl<'a> UnwindSafe for DirentHash<'a>
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