pub struct SearchFilter {
pub tree_id: u64,
pub start: Key,
pub end: Key,
pub min_transid: u64,
pub max_transid: u64,
}Expand description
Filter specifying which items to return from a tree search.
Filtering works in three stages:
- Select a tree by
tree_id(e.g. root tree, chunk tree, quota tree). - Return only items whose compound key
(objectid, item_type, offset)falls within the inclusive range[start, end]. Because the key is a compound tuple, the three components ofstartandendare not independent filters — they form a single ordered bound on the B-tree. This means items with unexpected types can appear if their compound key is betweenstartandend; callbacks should filter onhdr.item_typewhen they need a single type. - Trim results to only include items stored in metadata blocks whose
transaction ID falls within
[min_transid, max_transid].
Build a filter for common cases with SearchFilter::for_type or
SearchFilter::for_objectid_range.
Tree IDs and item type codes are the BTRFS_*_OBJECTID and BTRFS_*_KEY
constants from crate::raw, cast to u64 and u32 respectively at the
call site.
Fields§
§tree_id: u64Tree to search: a BTRFS_*_TREE_OBJECTID constant from crate::raw.
start: KeyLower bound of the key range (inclusive).
end: KeyUpper bound of the key range (inclusive).
min_transid: u64Lower bound on the metadata block transaction ID (inclusive).
max_transid: u64Upper bound on the metadata block transaction ID (inclusive).
Implementations§
Trait Implementations§
Source§impl Clone for SearchFilter
impl Clone for SearchFilter
Source§fn clone(&self) -> SearchFilter
fn clone(&self) -> SearchFilter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SearchFilter
impl RefUnwindSafe for SearchFilter
impl Send for SearchFilter
impl Sync for SearchFilter
impl Unpin for SearchFilter
impl UnsafeUnpin for SearchFilter
impl UnwindSafe for SearchFilter
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