Struct radicle_git_ext::tree::Tree
source · pub struct Tree<'a>(/* private fields */);
Expand description
A simplified representation of a git tree, intended mainly to be created from literals.
§Example
use radicle_git_ext::tree::{Tree, blob};
let my_tree = vec![
("README", blob(b"awe")),
("src", vec![("main.rs", blob(b"fn main() {}"))].into_iter().collect()),
]
.into_iter()
.collect::<Tree>();
assert_eq!(
format!("{:?}", my_tree),
"Tree(\
{\
\"README\": Blob(\
[\
97, \
119, \
101\
]\
), \
\"src\": Tree(\
Tree(\
{\
\"main.rs\": Blob(\
[\
102, \
110, \
32, \
109, \
97, \
105, \
110, \
40, \
41, \
32, \
123, \
125\
]\
)\
}\
)\
)\
}\
)"
)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Tree<'a>
impl<'a> RefUnwindSafe for Tree<'a>
impl<'a> Send for Tree<'a>
impl<'a> Sync for Tree<'a>
impl<'a> Unpin for Tree<'a>
impl<'a> UnwindSafe for Tree<'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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)