pub struct QualityLabels {
pub labels: Vec<QualityIssueLabel>,
}Expand description
Collection of quality issue labels with aggregation methods.
Fields§
§labels: Vec<QualityIssueLabel>All labels in this collection
Implementations§
Source§impl QualityLabels
impl QualityLabels
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create with pre-allocated capacity.
Sourcepub fn add(&mut self, label: QualityIssueLabel)
pub fn add(&mut self, label: QualityIssueLabel)
Add a label.
Sourcepub fn extend(&mut self, labels: impl IntoIterator<Item = QualityIssueLabel>)
pub fn extend(&mut self, labels: impl IntoIterator<Item = QualityIssueLabel>)
Extend with more labels.
Sourcepub fn count_by_type(&self) -> HashMap<LabeledIssueType, usize>
pub fn count_by_type(&self) -> HashMap<LabeledIssueType, usize>
Count labels by type.
Sourcepub fn count_by_processor(&self) -> HashMap<String, usize>
pub fn count_by_processor(&self) -> HashMap<String, usize>
Count labels by processor.
Sourcepub fn for_document(&self, document_id: &str) -> Vec<&QualityIssueLabel>
pub fn for_document(&self, document_id: &str) -> Vec<&QualityIssueLabel>
Get labels for a specific document.
Sourcepub fn for_field(&self, field_name: &str) -> Vec<&QualityIssueLabel>
pub fn for_field(&self, field_name: &str) -> Vec<&QualityIssueLabel>
Get labels for a specific field.
Sourcepub fn of_type(&self, issue_type: LabeledIssueType) -> Vec<&QualityIssueLabel>
pub fn of_type(&self, issue_type: LabeledIssueType) -> Vec<&QualityIssueLabel>
Get labels of a specific type.
Sourcepub fn summary(&self) -> QualityLabelSummary
pub fn summary(&self) -> QualityLabelSummary
Get summary statistics.
Sourcepub fn to_csv_rows(&self) -> Vec<Vec<String>>
pub fn to_csv_rows(&self) -> Vec<Vec<String>>
Convert to CSV rows.
Sourcepub fn csv_header() -> Vec<&'static str>
pub fn csv_header() -> Vec<&'static str>
Get CSV header.
Trait Implementations§
Source§impl Clone for QualityLabels
impl Clone for QualityLabels
Source§fn clone(&self) -> QualityLabels
fn clone(&self) -> QualityLabels
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 moreSource§impl Debug for QualityLabels
impl Debug for QualityLabels
Source§impl Default for QualityLabels
impl Default for QualityLabels
Source§fn default() -> QualityLabels
fn default() -> QualityLabels
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for QualityLabels
impl<'de> Deserialize<'de> for QualityLabels
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for QualityLabels
impl RefUnwindSafe for QualityLabels
impl Send for QualityLabels
impl Sync for QualityLabels
impl Unpin for QualityLabels
impl UnwindSafe for QualityLabels
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