Type Alias ExtentKey

Source
pub type ExtentKey = ExtentKeyV32;
Expand description

ExtentKey is a child of ObjectKey for Object attributes that have attached extents (at time of writing this was only the used for file contents).

Aliased Type§

struct ExtentKey {
    pub range: Range<u64>,
}

Fields§

§range: Range<u64>

Implementations§

Source§

impl ExtentKey

Source

pub fn new(range: Range<u64>) -> Self

Creates an ExtentKey.

Source

pub fn overlap(&self, other: &ExtentKey) -> Option<Range<u64>>

Returns the range of bytes common between this extent and |other|.

Source

pub fn search_key(&self) -> Self

Returns the search key for this extent; that is, a key which is <= this key under Ord and OrdLowerBound. This would be used when searching for an extent with |find| (when we want to find any overlapping extent, which could include extents that start earlier). For example, if the tree has extents 50..150 and 150..200 and we wish to read 100..200, we’d search for 0..101 which would set the iterator to 50..150.

Source

pub fn search_key_from_offset(offset: u64) -> Self

Similar to previous, but from an offset. Returns a search key that will find the first extent that touches offset..

Source

pub fn key_for_merge_into(&self) -> Self

Returns the merge key for this extent; that is, a key which is <= this extent and any other possibly overlapping extent, under Ord. This would be used to set the hint for |merge_into|.

For example, if the tree has extents 0..50, 50..150 and 150..200 and we wish to insert 100..150, we’d use a merge hint of 0..100 which would set the iterator to 50..150 (the first element > 100..150 under Ord).

Source

pub fn fuzzy_hash_partition(&self) -> ExtentKeyPartitionIterator

Returns an iterator over the ExtentKey partitions which overlap this key (see FuzzyHash).

Trait Implementations§

Source§

impl Ord for ExtentKey

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl OrdLowerBound for ExtentKey

Source§

impl OrdUpperBound for ExtentKey

Source§

impl PartialOrd for ExtentKey

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more