Struct libcasr::cluster::Cluster

source ·
pub struct Cluster {
    pub number: usize,
    /* private fields */
}
Expand description

Structure provides an abstraction for cluster with CASR reports

Fields§

§number: usize

Cluster number

Implementations§

source§

impl Cluster

source

pub fn new( number: usize, paths: Vec<PathBuf>, stacktraces: Vec<Stacktrace>, crashlines: Vec<String> ) -> Self

Create new Cluster

source

pub fn paths(&self) -> &Vec<PathBuf>

Get CASR report paths

source

pub fn stacktraces(&self) -> &Vec<Stacktrace>

Get CASR report stactraces

source

pub fn cluster_reports( reports: &[ReportInfo], offset: usize, dedup: bool ) -> Result<(HashMap<usize, Cluster>, usize, usize)>

Perform CASR reports clustering

§Arguments
  • reports - slice of ReportInfo

  • offset - cluster enumerate offset

  • dedup - deduplicate crashline, if true

§Return value
  • HashMap of Cluster with cluster number as key
  • Number of valid casreps before crashline deduplication
  • Number of valid casreps after crashline deduplication
source

pub fn insert( &mut self, path: PathBuf, stacktrace: Stacktrace, crashline: String, dedup: bool ) -> bool

Add new CASR report to cluster

§Arguments
  • stacktrace - new CASR report stacktrace

  • crashline - new CASR report crashline

  • dedup - deduplicate crashline, if true

§Return value

true if new CASR report may be added, false if report is duplicate of someone else

source

pub fn diam(&mut self) -> f64

Get cluster diameter

source

pub fn relation(&mut self, new: &Stacktrace) -> Relation

Get “relation” between new report and specified cluster

§Arguments
  • new - new report stacktrace
§Return value

Relation enum with proximity measure according specified strategy

source

pub fn dist(cluster1: &Cluster, cluster2: &Cluster) -> f64

Get complete distance between clusters NOTE: Result also can be interpreted as diameter of cluster merge result

source

pub fn dist_rep(cluster: &Cluster, report: &ReportInfo) -> f64

Get complete distance between cluster and report NOTE: Result also can be interpreted as diameter of cluster merge result

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.