pub enum DataInput {
Text(String),
FilePath(String),
Url(String),
S3Path(String),
Binary {
data: Vec<u8>,
name: String,
},
DataItem {
data: Box<DataInput>,
label: String,
external_metadata: Option<String>,
},
}Variants§
Text(String)
Raw text content
FilePath(String)
Local file path
Url(String)
HTTP/HTTPS URL
S3Path(String)
S3 path (s3://bucket/key) — TODO stub
Binary
In-memory binary data with a filename for MIME detection
DataItem
DataItem wrapper — wraps any other input with a custom label and optional metadata
Implementations§
Source§impl DataInput
impl DataInput
Sourcepub async fn process_by_chunks<F, Fut, E>(&self, callback: F) -> Result<(), E>
pub async fn process_by_chunks<F, Fut, E>(&self, callback: F) -> Result<(), E>
Process the input data by chunks, calling the provided callback for each chunk. This allows efficient streaming processing without loading entire files into memory.
§Arguments
callback- An async callback function that receives each chunk of data
Sourcepub fn from_string(s: String) -> Self
pub fn from_string(s: String) -> Self
Classify a string into the appropriate DataInput variant
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataInput
impl<'de> Deserialize<'de> for DataInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DataInput
impl RefUnwindSafe for DataInput
impl Send for DataInput
impl Sync for DataInput
impl Unpin for DataInput
impl UnsafeUnpin for DataInput
impl UnwindSafe for DataInput
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