Skip to main content

DataSource

Enum DataSource 

Source
pub enum DataSource {
    File {
        path: String,
        format: FileFormat,
        size_bytes: u64,
        modified_at: Option<String>,
        parquet_metadata: Option<ParquetMetadata>,
    },
    Query {
        engine: QueryEngine,
        statement: String,
        database: Option<String>,
        execution_id: Option<String>,
    },
    DataFrame {
        name: String,
        source_library: DataFrameLibrary,
        row_count: usize,
        column_count: usize,
        memory_bytes: Option<u64>,
    },
    Stream {
        topic: String,
        batch_id: String,
        partition: Option<u32>,
        consumer_group: Option<String>,
        source_system: StreamSourceSystem,
        session_id: Option<String>,
        first_record_at: Option<String>,
        last_record_at: Option<String>,
    },
}
Expand description

Source-agnostic data source metadata.

Variants§

§

File

File-based data source (CSV, JSON, Parquet, etc.)

Fields

§path: String

Absolute or relative path to the file

§format: FileFormat

Detected or specified file format

§size_bytes: u64

File size in bytes

§modified_at: Option<String>

Last modification timestamp (ISO 8601 / RFC 3339)

§parquet_metadata: Option<ParquetMetadata>

Parquet-specific metadata (only present for Parquet files)

§

Query

SQL query-based data source

Fields

§engine: QueryEngine

Database engine used for the query

§statement: String

SQL statement executed

§database: Option<String>

Target database name (if applicable)

§execution_id: Option<String>

Unique execution identifier for tracing

§

DataFrame

In-memory DataFrame source (pandas/polars via PyCapsule)

Fields

§name: String

User-provided name for identification

§source_library: DataFrameLibrary

Source library (pandas, polars, pyarrow)

§row_count: usize

Number of rows at profiling time

§column_count: usize

Number of columns

§memory_bytes: Option<u64>

Memory usage in bytes (if available)

§

Stream

Streaming data source

Fields

§topic: String

Stream identifier (e.g., Kafka topic, Kinesis stream name)

§batch_id: String

Batch identifier for ordering and deduplication

§partition: Option<u32>

Partition for parallel processing (optional)

§consumer_group: Option<String>

Consumer group for Kafka-style coordination (optional)

§source_system: StreamSourceSystem

Source system identifier (kafka, kinesis, pulsar, http, etc.)

§session_id: Option<String>

Session ID for multi-tenant scenarios

§first_record_at: Option<String>

Timestamp of first record in batch (ISO 8601)

§last_record_at: Option<String>

Timestamp of last record in batch (ISO 8601)

Implementations§

Source§

impl DataSource

Source

pub fn identifier(&self) -> String

Get a human-readable identifier for this data source.

Source

pub fn size_mb(&self) -> Option<f64>

Get file size in megabytes if this is a file-based source or dataframe.

Source

pub fn is_file(&self) -> bool

Check if this is a file-based source.

Source

pub fn is_query(&self) -> bool

Check if this is a query-based source.

Source

pub fn is_dataframe(&self) -> bool

Check if this is a DataFrame-based source.

Source

pub fn is_stream(&self) -> bool

Check if this is a Stream-based source.

Source

pub fn file_path(&self) -> Option<&str>

Get the file path if this is a file-based source.

Source

pub fn stream_topic(&self) -> Option<&str>

Get the stream topic if this is a stream-based source.

Source

pub fn batch_id(&self) -> Option<&str>

Get the batch ID if this is a stream-based source.

Trait Implementations§

Source§

impl Clone for DataSource

Source§

fn clone(&self) -> DataSource

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DataSource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DataSource

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DataSource

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,