pub struct Mapping {
pub config: Config,
pub filters: Vec<FieldPath>,
pub display: Vec<FieldPath>,
/* private fields */
}Expand description
The config compiled for fast per-record extraction.
Fields§
§config: Config§filters: Vec<FieldPath>§display: Vec<FieldPath>Implementations§
Source§impl Mapping
impl Mapping
pub fn new(config: &Config) -> Result<Self>
pub fn has_id(&self) -> bool
pub fn has_group(&self) -> bool
pub fn has_date(&self) -> bool
pub fn title_paths(&self) -> &[FieldPath]
pub fn text_paths(&self) -> &[FieldPath]
Sourcepub fn is_empty_value(&self, s: &str) -> bool
pub fn is_empty_value(&self, s: &str) -> bool
Missing, blank, or a configured placeholder.
Sourcepub fn strings(&self, path: &FieldPath, record: &Value) -> Vec<String>
pub fn strings(&self, path: &FieldPath, record: &Value) -> Vec<String>
Present text values at path, placeholders dropped.
pub fn first(&self, paths: &[FieldPath], record: &Value) -> Option<String>
pub fn record_id(&self, record: &Value) -> Option<String>
Sourcepub fn date_of(&self, record: &Value) -> Option<String>
pub fn date_of(&self, record: &Value) -> Option<String>
The record’s date, normalized when recognizable.
pub fn group_of(&self, record: &Value) -> (Option<String>, Option<String>)
pub fn prepare(&self, record: &Value) -> Prepared
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mapping
impl RefUnwindSafe for Mapping
impl Send for Mapping
impl Sync for Mapping
impl Unpin for Mapping
impl UnsafeUnpin for Mapping
impl UnwindSafe for Mapping
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