[−][src]Struct git_odb::pack::tree::Tree
A tree that allows one-time iteration over all nodes and their children, consuming it in the process, while being shareable among threads without a lock. It does this by making the run-time guarantee that iteration only happens once.
Implementations
impl<T> Tree<T>
[src][−]
Iteration
pub fn iter_root_chunks(&mut self, size: usize) -> Chunks<T>ⓘ
[src][−]
Return an iterator over chunks of roots. Roots are not children themselves, they have no parents.
impl<T> Tree<T> where
T: Default + Send,
[src][−]
T: Default + Send,
pub fn traverse<F, P, MBFN, S, E>(
self,
should_run_in_parallel: impl FnOnce() -> bool,
resolve: F,
object_progress: P,
size_progress: P,
thread_limit: Option<usize>,
pack_entries_end: u64,
new_thread_state: impl Fn() -> S + Send + Sync,
inspect_object: MBFN
) -> Result<Vec<Item<T>>, Error> where
F: for<'r> Fn(EntrySlice, &'r mut Vec<u8>) -> Option<()> + Send + Sync,
P: Progress + Send,
MBFN: Fn(&mut T, &mut <P as Progress>::SubProgress, Context<S>) -> Result<(), E> + Send + Sync,
E: Error + Send + Sync + 'static,
[src]
self,
should_run_in_parallel: impl FnOnce() -> bool,
resolve: F,
object_progress: P,
size_progress: P,
thread_limit: Option<usize>,
pack_entries_end: u64,
new_thread_state: impl Fn() -> S + Send + Sync,
inspect_object: MBFN
) -> Result<Vec<Item<T>>, Error> where
F: for<'r> Fn(EntrySlice, &'r mut Vec<u8>) -> Option<()> + Send + Sync,
P: Progress + Send,
MBFN: Fn(&mut T, &mut <P as Progress>::SubProgress, Context<S>) -> Result<(), E> + Send + Sync,
E: Error + Send + Sync + 'static,
impl<T> Tree<T>
[src][−]
Generate tree from certain input
pub fn from_offsets_in_pack(
data_sorted_by_offsets: impl Iterator<Item = T>,
get_pack_offset: impl Fn(&T) -> u64,
pack_path: impl AsRef<Path>,
progress: impl Progress,
resolve_in_pack_id: impl Fn(Id) -> Option<u64>
) -> Result<Self, Error>
[src][−]
data_sorted_by_offsets: impl Iterator<Item = T>,
get_pack_offset: impl Fn(&T) -> u64,
pack_path: impl AsRef<Path>,
progress: impl Progress,
resolve_in_pack_id: impl Fn(Id) -> Option<u64>
) -> Result<Self, Error>
The sort order is ascending. The given packfile path must match the provided offsets.
impl<T> Tree<T>
[src][−]
pub fn with_capacity(num_objects: usize) -> Result<Self, Error>
[src]
pub fn add_root(&mut self, offset: u64, data: T) -> Result<(), Error>
[src]
pub fn add_child(
&mut self,
base_offset: u64,
offset: u64,
data: T
) -> Result<(), Error>
[src]
&mut self,
base_offset: u64,
offset: u64,
data: T
) -> Result<(), Error>
pub fn into_items(self) -> Vec<Item<T>>
[src]
Trait Implementations
impl<T> Sync for Tree<T>
[src]
SAFETY: We solemnly swear…that this is sync because without the unsafe cell, it is also sync. But that's really the only reason why I would dare to know.
Auto Trait Implementations
impl<T> !RefUnwindSafe for Tree<T>
impl<T> Send for Tree<T> where
T: Send,
T: Send,
impl<T> Unpin for Tree<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Tree<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,