pub struct RawSource { /* private fields */ }Expand description
Raw source data container
Handles pasted/clipboard data with automatic format detection and conversion to Arrow RecordBatch.
Implementations§
Source§impl RawSource
impl RawSource
Sourcepub fn from_string(data: impl Into<String>, source_type: SourceType) -> Self
pub fn from_string(data: impl Into<String>, source_type: SourceType) -> Self
Create a new RawSource from a string
Sourcepub fn from_clipboard(data: impl Into<String>) -> Self
pub fn from_clipboard(data: impl Into<String>) -> Self
Create from clipboard content
Sourcepub fn from_stdin(data: impl Into<String>) -> Self
pub fn from_stdin(data: impl Into<String>) -> Self
Create from stdin content
Sourcepub fn with_config(self, config: RawSourceConfig) -> Self
pub fn with_config(self, config: RawSourceConfig) -> Self
Create with custom configuration
Sourcepub fn source_type(&self) -> SourceType
pub fn source_type(&self) -> SourceType
Get the source type
Sourcepub fn detect_format(&self) -> DetectedFormat
pub fn detect_format(&self) -> DetectedFormat
Detect the format of the data
Sourcepub fn parse(&mut self) -> Result<RecordBatch>
pub fn parse(&mut self) -> Result<RecordBatch>
Parse the raw data into an Arrow RecordBatch
§Errors
Returns an error if the data cannot be parsed (invalid CSV, JSON, etc.).
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Get the number of lines in the raw data
Trait Implementations§
Source§impl ServeableContent for RawSource
impl ServeableContent for RawSource
Source§fn schema(&self) -> ContentSchema
fn schema(&self) -> ContentSchema
Returns the content schema for validation and UI generation
Source§fn to_arrow(&self) -> Result<RecordBatch>
fn to_arrow(&self) -> Result<RecordBatch>
Converts content to Arrow RecordBatch for efficient transfer Read more
Source§fn metadata(&self) -> ContentMetadata
fn metadata(&self) -> ContentMetadata
Returns content metadata for indexing and discovery
Source§fn content_type(&self) -> ContentTypeId
fn content_type(&self) -> ContentTypeId
Returns content type identifier
Auto Trait Implementations§
impl Freeze for RawSource
impl !RefUnwindSafe for RawSource
impl Send for RawSource
impl Sync for RawSource
impl Unpin for RawSource
impl UnsafeUnpin for RawSource
impl !UnwindSafe for RawSource
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.