pub struct Schema {
pub fields: Vec<String>,
/* private fields */
}Expand description
Dictionary schema that defines the structure of dictionary entries
Fields§
§fields: Vec<String>All field names including common fields (surface, left_context_id, right_context_id, cost, …)
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn get_field_index(&self, field_name: &str) -> Option<usize>
pub fn get_field_index(&self, field_name: &str) -> Option<usize>
Get field index by name
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Get total field count
Sourcepub fn get_field_name(&self, index: usize) -> Option<&str>
pub fn get_field_name(&self, index: usize) -> Option<&str>
Get field name by index
Sourcepub fn get_custom_fields(&self) -> &[String]
pub fn get_custom_fields(&self) -> &[String]
Get custom fields (index >= 4)
Sourcepub fn get_all_fields(&self) -> &[String]
pub fn get_all_fields(&self) -> &[String]
Get all fields
Sourcepub fn validate_fields(&self, row: &StringRecord) -> LinderaResult<()>
pub fn validate_fields(&self, row: &StringRecord) -> LinderaResult<()>
Validate that CSV row has all required fields
Source§impl Schema
impl Schema
Sourcepub fn get_field_by_name(&self, name: &str) -> Option<FieldDefinition>
pub fn get_field_by_name(&self, name: &str) -> Option<FieldDefinition>
Find field by name (backward compatibility)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
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 Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
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