pub struct CoreSchema { /* private fields */ }Expand description
Dictionary schema shared by the bindings.
Owns the field storage, the name-to-index map, and the field lookups by
delegating to lindera::dictionary::Schema, so each binding can wrap a
CoreSchema instead of reimplementing the same logic.
Implementations§
Source§impl CoreSchema
impl CoreSchema
Sourcepub fn create_default() -> Self
pub fn create_default() -> Self
Creates the default binding schema (see default_dictionary_fields).
Sourcepub fn get_field_index(&self, field_name: &str) -> Option<usize>
pub fn get_field_index(&self, field_name: &str) -> Option<usize>
Returns the index of field_name, if present.
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Returns the total number of fields.
Sourcepub fn get_field_name(&self, index: usize) -> Option<&str>
pub fn get_field_name(&self, index: usize) -> Option<&str>
Returns the field name at index, if present.
Sourcepub fn get_custom_fields(&self) -> &[String]
pub fn get_custom_fields(&self) -> &[String]
Returns the custom fields (everything after the four system fields).
Sourcepub fn get_field_by_name(&self, name: &str) -> Option<CoreFieldDefinition>
pub fn get_field_by_name(&self, name: &str) -> Option<CoreFieldDefinition>
Returns the CoreFieldDefinition for name, if present.
Sourcepub fn validate_record(&self, record: &[String]) -> CoreResult<()>
pub fn validate_record(&self, record: &[String]) -> CoreResult<()>
Validates a CSV record against this schema.
Returns an ErrorKind::Validation error
when the record has too few fields or a required field is empty.
Sourcepub fn as_lindera(&self) -> &Schema
pub fn as_lindera(&self) -> &Schema
Borrows the backing lindera schema.
Sourcepub fn into_lindera(self) -> Schema
pub fn into_lindera(self) -> Schema
Consumes this schema and returns the backing lindera schema.
Trait Implementations§
Source§impl Clone for CoreSchema
impl Clone for CoreSchema
Source§fn clone(&self) -> CoreSchema
fn clone(&self) -> CoreSchema
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CoreSchema
impl Debug for CoreSchema
Source§impl From<CoreSchema> for Schema
impl From<CoreSchema> for Schema
Source§fn from(schema: CoreSchema) -> Self
fn from(schema: CoreSchema) -> Self
Unwraps the backing lindera Schema.
Auto Trait Implementations§
impl Freeze for CoreSchema
impl RefUnwindSafe for CoreSchema
impl Send for CoreSchema
impl Sync for CoreSchema
impl Unpin for CoreSchema
impl UnsafeUnpin for CoreSchema
impl UnwindSafe for CoreSchema
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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>
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
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.