pub struct NameHeuristics {
pub rules: Vec<NameRule>,
}Expand description
Ordered list of name-matching rules loaded from heuristics_name.toml.
Fields§
§rules: Vec<NameRule>Implementations§
Source§impl NameHeuristics
impl NameHeuristics
Sourcepub fn from_toml_str(s: &str) -> Result<Self, ZerError>
pub fn from_toml_str(s: &str) -> Result<Self, ZerError>
Parse from a TOML string.
Sourcepub fn load_default() -> Self
pub fn load_default() -> Self
Load the default heuristics.
Checks ZER_NAME_HEURISTICS env var first; if set and loadable, uses
that file. Otherwise falls back to the embedded heuristics_name.toml.
Sourcepub fn infer_kind(&self, name: &str) -> Option<FieldKind>
pub fn infer_kind(&self, name: &str) -> Option<FieldKind>
Try to match a column name against the rules. Returns None when no
rule matches, signalling the caller to fall back to value sampling.
Trait Implementations§
Source§impl Clone for NameHeuristics
impl Clone for NameHeuristics
Source§fn clone(&self) -> NameHeuristics
fn clone(&self) -> NameHeuristics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 NameHeuristics
impl Debug for NameHeuristics
Source§impl<'de> Deserialize<'de> for NameHeuristics
impl<'de> Deserialize<'de> for NameHeuristics
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 NameHeuristics
impl RefUnwindSafe for NameHeuristics
impl Send for NameHeuristics
impl Sync for NameHeuristics
impl Unpin for NameHeuristics
impl UnsafeUnpin for NameHeuristics
impl UnwindSafe for NameHeuristics
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