pub enum Format {
Csv {
delimiter: u8,
},
Json,
Yaml,
}Expand description
Export output format. CSV carries the delimiter byte so callers can pick comma / semicolon / tab without a separate enum.
Variants§
Csv
Comma-separated values. The delimiter is configurable: b',' for
RFC 4180, b';' for European-style CSV, b'\t' for TSV.
Json
Pretty-printed JSON.
Yaml
YAML.
Implementations§
Source§impl Format
impl Format
Sourcepub fn from_path(path: &Path) -> Result<Self>
pub fn from_path(path: &Path) -> Result<Self>
Infer the format from a path’s extension.
.csv→Csv { delimiter: b',' }.tsv→Csv { delimiter: b'\t' }.json→Json.yaml/.yml→Yaml.xlsx→Xlsx(requiresxlsxfeature).md→ refused (.mdis the vault’s note format, not an export format)- everything else → error listing the supported extensions
Sourcepub fn with_csv_delimiter(self, delimiter: u8) -> Self
pub fn with_csv_delimiter(self, delimiter: u8) -> Self
Override the CSV delimiter. No-op on non-CSV formats.
Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
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<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
Compare self to
key and return true if they are equal.