pub struct CodeLookup { /* private fields */ }Expand description
Complete code lookup table built from a PID schema JSON.
Implementations§
Source§impl CodeLookup
impl CodeLookup
Sourcepub fn from_schema_file(path: &Path) -> Result<Self, Error>
pub fn from_schema_file(path: &Path) -> Result<Self, Error>
Build a CodeLookup from a PID schema JSON file.
Sourcepub fn from_schema_value(schema: &Value) -> Self
pub fn from_schema_value(schema: &Value) -> Self
Build a CodeLookup from an already-parsed PID schema JSON value.
Sourcepub fn is_code_field(
&self,
source_path: &str,
segment_tag: &str,
element_index: usize,
component_index: usize,
) -> bool
pub fn is_code_field( &self, source_path: &str, segment_tag: &str, element_index: usize, component_index: usize, ) -> bool
Check if a companion field at the given position is a code-type field.
Sourcepub fn enrichment_for(
&self,
source_path: &str,
segment_tag: &str,
element_index: usize,
component_index: usize,
value: &str,
) -> Option<&CodeEnrichment>
pub fn enrichment_for( &self, source_path: &str, segment_tag: &str, element_index: usize, component_index: usize, value: &str, ) -> Option<&CodeEnrichment>
Get the full enrichment data for a code value at the given position.
Returns None if the position is not a code field or the value is unknown.
Trait Implementations§
Source§impl Clone for CodeLookup
impl Clone for CodeLookup
Source§fn clone(&self) -> CodeLookup
fn clone(&self) -> CodeLookup
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 CodeLookup
impl Debug for CodeLookup
Source§impl Default for CodeLookup
impl Default for CodeLookup
Source§fn default() -> CodeLookup
fn default() -> CodeLookup
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CodeLookup
impl<'de> Deserialize<'de> for CodeLookup
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CodeLookup
impl RefUnwindSafe for CodeLookup
impl Send for CodeLookup
impl Sync for CodeLookup
impl Unpin for CodeLookup
impl UnsafeUnpin for CodeLookup
impl UnwindSafe for CodeLookup
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