pub struct Prefetch {
pub policy: PrefetchPolicy,
pub disabled: bool,
/* private fields */
}Expand description
Manage filesystem data prefetch configuration and state for builder.
Fields§
§policy: PrefetchPolicy§disabled: boolImplementations§
Source§impl Prefetch
impl Prefetch
Sourcepub fn new(policy: PrefetchPolicy) -> Result<Self>
pub fn new(policy: PrefetchPolicy) -> Result<Self>
Create a new instance of Prefetch.
Sourcepub fn insert(&mut self, obj: &TreeNode, node: &Node)
pub fn insert(&mut self, obj: &TreeNode, node: &Node)
Insert node into the prefetch Vector if it matches prefetch rules, while recording the index of matched prefetch pattern, or insert it into non-prefetch Vector.
Sourcepub fn get_file_nodes(&self) -> (Vec<TreeNode>, Vec<TreeNode>)
pub fn get_file_nodes(&self) -> (Vec<TreeNode>, Vec<TreeNode>)
Get node Vector of files in the prefetch list and non-prefetch list. The order of prefetch files is the same as the order of prefetch patterns. The order of non-prefetch files is the same as the order of BFS traversal of file tree.
Sourcepub fn fs_prefetch_rule_count(&self) -> u32
pub fn fs_prefetch_rule_count(&self) -> u32
Get the number of valid prefetch rules.
Sourcepub fn get_v5_prefetch_table(&mut self) -> Option<RafsV5PrefetchTable>
pub fn get_v5_prefetch_table(&mut self) -> Option<RafsV5PrefetchTable>
Generate filesystem layer prefetch list for RAFS v5.
Sourcepub fn get_v6_prefetch_table(
&mut self,
meta_addr: u64,
) -> Option<RafsV6PrefetchTable>
pub fn get_v6_prefetch_table( &mut self, meta_addr: u64, ) -> Option<RafsV6PrefetchTable>
Generate filesystem layer prefetch list for RAFS v6.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Prefetch
impl !RefUnwindSafe for Prefetch
impl !Send for Prefetch
impl !Sync for Prefetch
impl Unpin for Prefetch
impl !UnwindSafe for Prefetch
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