pub struct UploadBuilder { /* private fields */ }Expand description
Builder for uploading files directly to a file search store.
This uploads file data and processes it in one step. The file is chunked, embedded, and indexed. A temporary file reference is created but deleted after 48 hours, while the indexed data persists in the store.
§Example
use gemini_rust::prelude::*;
use mime::TEXT_PLAIN;
let data = b"Document content here";
let mut operation = store
.upload(data.to_vec())
.with_display_name("My Document")
.with_mime_type(TEXT_PLAIN)
.execute()
.await?;
// Wait for processing
operation.wait_until_done(
std::time::Duration::from_secs(5),
Some(std::time::Duration::from_secs(60))
).await?;Implementations§
Source§impl UploadBuilder
impl UploadBuilder
pub fn with_display_name(self, name: impl Into<String>) -> Self
pub fn with_mime_type(self, mime_type: Mime) -> Self
pub fn with_custom_metadata(self, metadata: Vec<CustomMetadata>) -> Self
pub fn with_chunking_config(self, config: ChunkingConfig) -> Self
pub async fn execute(self) -> Result<OperationHandle, Error>
Auto Trait Implementations§
impl Freeze for UploadBuilder
impl !RefUnwindSafe for UploadBuilder
impl Send for UploadBuilder
impl Sync for UploadBuilder
impl Unpin for UploadBuilder
impl !UnwindSafe for UploadBuilder
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