pub struct Schema {
pub columns: Vec<ColumnMeta>,
pub schema_version: Option<String>,
pub has_headers: bool,
}Fields§
§columns: Vec<ColumnMeta>§schema_version: Option<String>§has_headers: boolImplementations§
Source§impl Schema
impl Schema
pub fn from_headers(headers: &[String]) -> Self
pub const fn default_has_headers() -> bool
pub fn expects_headers(&self) -> bool
pub fn column_index(&self, name: &str) -> Option<usize>
pub fn headers(&self) -> Vec<String>
pub fn output_headers(&self) -> Vec<String>
pub fn validate_headers(&self, headers: &[String]) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
pub fn save_with_replace_template(&self, path: &Path) -> Result<()>
pub fn to_yaml_string(&self, include_replace_template: bool) -> Result<String>
pub fn load(path: &Path) -> Result<Self>
Source§impl Schema
impl Schema
pub fn has_transformations(&self) -> bool
pub fn apply_transformations_to_row(&self, row: &mut [String]) -> Result<()>
pub fn apply_replacements_to_row(&self, row: &mut [String])
pub fn validate_datatype_mappings(&self) -> Result<()>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more