data capa

data-export

Data export (CSV, JSON, Excel) for Rust applications

Data export (CSV, JSON, Excel) for Rust applications

Tierdata
Roleunclassified (baselined)
Pathcrates/data/export
Edition2021
Targetsdata_export
Public items51 across 0 modules
Tests25

What it is for

Bulk data export library crates for Rust applications.

Provides structured data export to various formats including CSV, JSON, and Excel.

Capabilities

CsvExporter

Bulk data export library crates for Rust applications.

Item
pub struct CsvExporter
CsvExporter :: fn new(config : ExportConfig) -> Self
CsvExporter :: fn export <T : Serialize>(& self, data : & T) -> Result <String>

ExportColumn

Bulk data export library crates for Rust applications.

Item
pub struct ExportColumn
ExportColumn :: fn new(name : impl Into <String>, source_field : impl Into <String>) -> Self
ExportColumn :: fn with_display_name(mut self, display_name : impl Into <String>) -> Self
ExportColumn :: fn with_format(mut self, format : impl Into <String>) -> Self
ExportColumn :: fn header(& self) -> & str

ExportConfig

Bulk data export library crates for Rust applications.

Item
pub struct ExportConfig
ExportConfig :: fn default() -> Self
ExportConfig :: fn new(format : ExportFormat) -> Self
ExportConfig :: fn with_column(mut self, column : ExportColumn) -> Self
ExportConfig :: fn with_columns(mut self, columns : Vec <ExportColumn>) -> Self
ExportConfig :: fn with_filter(mut self, key : impl Into <String>, value : impl Into <String>) -> Self
ExportConfig :: fn with_headers(mut self, include : bool) -> Self
ExportConfig :: fn with_delimiter(mut self, delimiter : char) -> Self
ExportConfig :: fn with_max_rows(mut self, max : usize) -> Self
ExportConfig :: fn with_date_format(mut self, format : impl Into <String>) -> Self

ExportError

Bulk data export library crates for Rust applications.

Item
pub enum ExportError

ExportFormat

Bulk data export library crates for Rust applications.

Item
pub enum ExportFormat
ExportFormat :: fn extension(& self) -> & 'static str
ExportFormat :: fn mime_type(& self) -> & 'static str

ExportJob

Bulk data export library crates for Rust applications.

Item
pub struct ExportJob
ExportJob :: fn new(name : impl Into <String>, config : ExportConfig) -> Self
ExportJob :: fn with_created_by(mut self, user_id : Uuid) -> Self
ExportJob :: fn with_expires_at(mut self, expires_at : DateTime <Utc>) -> Self
ExportJob :: fn start(& mut self) -> Result <()>
ExportJob :: fn update_progress(& mut self, exported : usize, total : Option <usize>)
ExportJob :: fn complete(& mut self, file_path : String, file_size : u64)
ExportJob :: fn fail(& mut self, error : impl Into <String>)
ExportJob :: fn cancel(& mut self) -> Result <()>
ExportJob :: fn expire(& mut self)
ExportJob :: fn is_expired(& self) -> bool
ExportJob :: fn filename(& self) -> String

ExportStatus

Bulk data export library crates for Rust applications.

Item
pub enum ExportStatus
ExportStatus :: fn is_terminal(& self) -> bool
ExportStatus :: fn can_cancel(& self) -> bool
ExportStatus :: fn as_str(& self) -> & 'static str
ExportStatus :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
ExportStatus :: fn from_str(s : & str) -> std::result::Result <Self, Self::Err>

ExportTemplate

Bulk data export library crates for Rust applications.

Item
pub struct ExportTemplate
ExportTemplate :: fn new(name : impl Into <String>, entity_type : impl Into <String>, config : ExportConfig,) -> Self
ExportTemplate :: fn with_description(mut self, description : impl Into <String>) -> Self
ExportTemplate :: fn with_public(mut self, is_public : bool) -> Self
ExportTemplate :: fn with_created_by(mut self, user_id : Uuid) -> Self
ExportTemplate :: fn create_job(& self, name : impl Into <String>) -> ExportJob

JsonExporter

Bulk data export library crates for Rust applications.

Item
pub struct JsonExporter
JsonExporter :: fn new(config : ExportConfig) -> Self
JsonExporter :: fn export <T : Serialize>(& self, data : & T) -> Result <String>
JsonExporter :: fn export_lines <T : Serialize>(& self, data : & T) -> Result <String>

Result

Bulk data export library crates for Rust applications.

Item
pub type Result<T>: std::result::Result <T, ExportError>

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub enum ExportErrorExport errors.
pub type Result<T>: std::result::Result <T, ExportError>Result type for export operations.
pub enum ExportFormatSupported export formats.
ExportFormat :: fn extension(& self) -> & 'static strGet the file extension for this format.
ExportFormat :: fn mime_type(& self) -> & 'static strGet the MIME type for this format.
pub enum ExportStatusExport job status.
ExportStatus :: fn is_terminal(& self) -> boolCheck if the export is in a terminal state.
ExportStatus :: fn can_cancel(& self) -> boolCheck if the export can be cancelled.
ExportStatus :: fn as_str(& self) -> & 'static strReturns the string representation for database storage.
ExportStatus :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
ExportStatus :: fn from_str(s : & str) -> std::result::Result <Self, Self::Err>
pub struct ExportColumnColumn definition for export.
ExportColumn :: fn new(name : impl Into <String>, source_field : impl Into <String>) -> SelfCreate a new export column.
ExportColumn :: fn with_display_name(mut self, display_name : impl Into <String>) -> SelfSet the display name.
ExportColumn :: fn with_format(mut self, format : impl Into <String>) -> SelfSet the format string.
ExportColumn :: fn header(& self) -> & strGet the header name for this column.
pub struct ExportConfigExport configuration.
ExportConfig :: fn default() -> Self
ExportConfig :: fn new(format : ExportFormat) -> SelfCreate a new export configuration.
ExportConfig :: fn with_column(mut self, column : ExportColumn) -> SelfAdd a column to export.
ExportConfig :: fn with_columns(mut self, columns : Vec <ExportColumn>) -> SelfAdd multiple columns.
ExportConfig :: fn with_filter(mut self, key : impl Into <String>, value : impl Into <String>) -> SelfAdd a filter.
ExportConfig :: fn with_headers(mut self, include : bool) -> SelfSet whether to include headers.
ExportConfig :: fn with_delimiter(mut self, delimiter : char) -> SelfSet the delimiter (for CSV).
ExportConfig :: fn with_max_rows(mut self, max : usize) -> SelfSet the maximum number of rows.
ExportConfig :: fn with_date_format(mut self, format : impl Into <String>) -> SelfSet the date format.
pub struct ExportJobExport job representing an async export operation.
ExportJob :: fn new(name : impl Into <String>, config : ExportConfig) -> SelfCreate a new export job.
ExportJob :: fn with_created_by(mut self, user_id : Uuid) -> SelfSet the creator.
ExportJob :: fn with_expires_at(mut self, expires_at : DateTime <Utc>) -> SelfSet expiration time.
ExportJob :: fn start(& mut self) -> Result <()>Start processing the export.
ExportJob :: fn update_progress(& mut self, exported : usize, total : Option <usize>)Update progress.
ExportJob :: fn complete(& mut self, file_path : String, file_size : u64)Mark the export as completed.
ExportJob :: fn fail(& mut self, error : impl Into <String>)Mark the export as failed.
ExportJob :: fn cancel(& mut self) -> Result <()>Cancel the export.
ExportJob :: fn expire(& mut self)Mark as expired.
ExportJob :: fn is_expired(& self) -> boolCheck if the export has expired.
ExportJob :: fn filename(& self) -> StringGet the filename for download.
pub struct ExportTemplateExport template for reusable export configurations.
ExportTemplate :: fn new(name : impl Into <String>, entity_type : impl Into <String>, config : ExportConfig,) -> SelfCreate a new export template.
ExportTemplate :: fn with_description(mut self, description : impl Into <String>) -> SelfSet description.
ExportTemplate :: fn with_public(mut self, is_public : bool) -> SelfSet as public.
ExportTemplate :: fn with_created_by(mut self, user_id : Uuid) -> SelfSet creator.
ExportTemplate :: fn create_job(& self, name : impl Into <String>) -> ExportJobCreate an export job from this template.
pub struct CsvExporterSimple CSV exporter for synchronous exports.
CsvExporter :: fn new(config : ExportConfig) -> SelfCreate a new CSV exporter.
CsvExporter :: fn export <T : Serialize>(& self, data : & T) -> Result <String>Export data to CSV string.
pub struct JsonExporterSimple JSON exporter.
JsonExporter :: fn new(config : ExportConfig) -> SelfCreate a new JSON exporter.
JsonExporter :: fn export <T : Serialize>(& self, data : & T) -> Result <String>Export data to JSON string.
JsonExporter :: fn export_lines <T : Serialize>(& self, data : & T) -> Result <String>Export data to JSON lines format.

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier data with 2 other crates: data-import, data-webhooks.

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)data
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/data/export
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
thiserror^2noalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1fullnoalways

Build. None.

Depended on by. 2 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_export["application-export"] -->|uses| SELF
  n_operations_net_discovery["operations-net-discovery"] -->|uses| SELF
  SELF["data-export"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libdata_export`src/lib.rs`

Error model

Error typeNamed by
ExportErrorResult

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

2 workspace crates depend on this one: application-export, operations-net-discovery.

Verification

KindCount
Unit tests25
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root1004

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc4851
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 48
    "No rustdoc detected" : 3

Metrics

MetricValue
Rust source files1
Source lines906
Code lines720
Public API items51
Public modules0
Tests25
Examples0
Cargo features0
Direct runtime dependencies6
Workspace reverse dependencies2
pie showData
    title Public API by kind
    "enum" : 3
    "method" : 41
    "struct" : 6
    "type alias" : 1
pie showData
    title Rust source composition
    "Code" : 720
    "Blank or comment" : 186

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las data · Manual