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 Archive for Schema
impl Archive for Schema
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize. Read moreSource§type Archived = ArchivedSchema
type Archived = ArchivedSchema
The archived representation of this type. Read more
Source§type Resolver = SchemaResolver
type Resolver = SchemaResolver
The resolver for this type. It must contain all the additional
information from serializing needed to make the archived type from
the normal type.
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Creates the archived version of the metadata for this value.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.