pub enum FileSourceFormat {
Auto,
JsonLines,
JsonArray,
Csv,
Xml,
Xlsx,
Parquet,
RawText,
Avro,
Orc,
}Expand description
The format choice — auto by extension, per file, or one fixed format.
Shared with the file sink through faucet-common-file.
Which format a file is in: resolved from its extension (auto) or fixed.
Variants§
Auto
Resolve per file from its extension, looking through a compression
suffix (.csv.gz is CSV): .jsonl/.ndjson, .json, .csv, .xml,
.xlsx, .parquet, .avro, .orc, .txt.
JsonLines
One JSON value per line.
JsonArray
A JSON array (a lone object is one record).
Csv
Delimited text; dialect from csv.
Xml
XML; record framing from xml.
Xlsx
An Excel workbook; sheet from excel.
Parquet
Apache Parquet.
RawText
Unparsed text, one record per file.
Avro
Apache Avro Object Container File; schema and codec from avro.
Orc
Apache ORC (read-only); projection from orc.
Implementations§
Source§impl FileFormatChoice
impl FileFormatChoice
Sourcepub fn explicit(self) -> Option<FileFormat>
pub fn explicit(self) -> Option<FileFormat>
The explicit format, or None for auto.
Sourcepub fn resolve(
self,
name: &str,
strict: bool,
) -> Result<Option<FileFormat>, FaucetError>
pub fn resolve( self, name: &str, strict: bool, ) -> Result<Option<FileFormat>, FaucetError>
The format of the file called name (a path or a URL’s last segment).
Ok(None) when auto finds no format and strict is off — the caller
skips the file; with strict it is an error naming the file.
Source§impl FileFormatChoice
impl FileFormatChoice
Sourcepub fn resolve_writable(self, name: &str) -> Result<FileFormat, FaucetError>
pub fn resolve_writable(self, name: &str) -> Result<FileFormat, FaucetError>
The format a file called name is written in: the explicit format,
or the one its extension names. Refuses a name with no recognised
extension and ORC, which has no writer.
Trait Implementations§
Source§impl Clone for FileFormatChoice
impl Clone for FileFormatChoice
Source§fn clone(&self) -> FileFormatChoice
fn clone(&self) -> FileFormatChoice
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FileFormatChoice
Source§impl Debug for FileFormatChoice
impl Debug for FileFormatChoice
Source§impl Default for FileFormatChoice
impl Default for FileFormatChoice
Source§fn default() -> FileFormatChoice
fn default() -> FileFormatChoice
Source§impl<'de> Deserialize<'de> for FileFormatChoice
impl<'de> Deserialize<'de> for FileFormatChoice
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FileFormatChoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FileFormatChoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for FileFormatChoice
Source§impl JsonSchema for FileFormatChoice
impl JsonSchema for FileFormatChoice
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for FileFormatChoice
impl PartialEq for FileFormatChoice
Source§impl Serialize for FileFormatChoice
impl Serialize for FileFormatChoice
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for FileFormatChoice
Auto Trait Implementations§
impl Forget for FileFormatChoice
impl Freeze for FileFormatChoice
impl Move for FileFormatChoice
impl RefUnwindSafe for FileFormatChoice
impl Send for FileFormatChoice
impl Sync for FileFormatChoice
impl Unpin for FileFormatChoice
impl UnsafeUnpin for FileFormatChoice
impl UnwindSafe for FileFormatChoice
Blanket Implementations§
impl<T> Allocation for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.