Skip to main content

VerifiedPair

Struct VerifiedPair 

Source
pub struct VerifiedPair {
    pub members: Vec<usize>,
    pub canonical: usize,
    pub fingerprint: CloneGroupFingerprint,
    pub similarity: f64,
    pub breakdown: Option<SimilarityBreakdown>,
    pub class: CloneClass,
    pub confidence: Confidence,
    pub boilerplate: Option<Boilerplate>,
    pub width_family: bool,
}
Expand description

A verified clone relation between two contents that no reported group could hold.

The two contents are clones of each other by the judge’s own verdict; what they are not is members of one set whose every pair is a clone, which is what a group asserts. Similarity is not transitive, so a unit can be a clone of two others that are not clones of each other, and a partition into groups can keep only one of those relations. The other is evidence the judge accepted, and it leaves the analysis here rather than being dropped.

The entry describes contents, not one pair of places. Where a codebase holds eight copies of one content and eight of another, the judge reaches the same verdict about all sixty-four crossings of them, and reporting sixty-four entries states one fact sixty-four times — all of them under one identity, because a clone id is composed from member content and two entries over the same two contents cannot differ. So every unit the folded verdicts touched is a member here, and there is one entry per pair of contents.

Fields§

§members: Vec<usize>

Every unit the folded verdicts touched, in unit-index order.

§canonical: usize

Which member is the canonical instance. Which content is canonical follows content order, so it does not depend on where either was found; among the occurrences of that content the first in member order stands for it, and they are interchangeable by construction.

§fingerprint: CloneGroupFingerprint

The relation’s stable, position-free clone id, composed exactly as a group’s is: a pair is a group of two contents, and nothing about its identity should say otherwise.

§similarity: f64

The strongest composite similarity among the folded verdicts.

§breakdown: Option<SimilarityBreakdown>

Per-dimension evidence for the weakest accepted crossing represented by this pair. It is absent only for callers that constructed a scalar edge without verifier evidence.

§class: CloneClass

What the judge classified the relation as.

§confidence: Confidence

The judge’s confidence in that classification.

§boilerplate: Option<Boilerplate>

The boilerplate category shared by the relation’s members, when one category dominates them under the same policy used for normal groups.

§width_family: bool

Whether the relation is one routine written once per integer width.

Implementations§

Source§

impl VerifiedPair

Source

pub fn holds(&self, unit: usize) -> bool

Whether unit is one of the members.

Trait Implementations§

Source§

impl Clone for VerifiedPair

Source§

fn clone(&self) -> VerifiedPair

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VerifiedPair

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for VerifiedPair

Source§

fn eq(&self, other: &VerifiedPair) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VerifiedPair

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.