pub struct UnitRef {
pub file: usize,
pub unit: usize,
pub node_count: u32,
}Expand description
A reference to one unit inside a slice of FileFeatures.
The unit-level candidate stages all speak in these: file indexes the slice
they were given, unit indexes that file’s FileFeatures::units, and
node_count is carried along because every stage that proposes unit pairs
gates them on relative size.
Fields§
§file: usizeIndex of the file in the input slice.
unit: usizeIndex of the unit in the file’s units.
node_count: u32Node count of the unit subtree; the size used by length-ratio gates.
Implementations§
Source§impl UnitRef
impl UnitRef
Sourcepub fn within_length_ratio(self, other: Self, max_ratio: f64) -> bool
pub fn within_length_ratio(self, other: Self, max_ratio: f64) -> bool
Whether this unit and other are within max_ratio of each other in
size. A large and a small unit are not a gapped copy of one another
however their features happened to meet, so every stage that proposes
unit pairs applies this before emitting one.
Trait Implementations§
impl Copy for UnitRef
impl Eq for UnitRef
Source§impl Ord for UnitRef
impl Ord for UnitRef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for UnitRef
impl PartialOrd for UnitRef
impl StructuralPartialEq for UnitRef
Auto Trait Implementations§
impl Freeze for UnitRef
impl RefUnwindSafe for UnitRef
impl Send for UnitRef
impl Sync for UnitRef
impl Unpin for UnitRef
impl UnsafeUnpin for UnitRef
impl UnwindSafe for UnitRef
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.