pub struct ExportService<S>where
S: DatasetStore,{ /* private fields */ }Expand description
Service for exporting datasets in streaming mode.
Uses DatasetStore::list_stream to fetch datasets incrementally,
avoiding loading all data into memory at once.
Implementations§
Source§impl<S> ExportService<S>where
S: DatasetStore,
impl<S> ExportService<S>where
S: DatasetStore,
Sourcepub async fn export_to_writer<W: Write>(
&self,
writer: &mut W,
format: ExportFormat,
portal_filter: Option<&str>,
limit: Option<usize>,
) -> Result<u64, AppError>
pub async fn export_to_writer<W: Write>( &self, writer: &mut W, format: ExportFormat, portal_filter: Option<&str>, limit: Option<usize>, ) -> Result<u64, AppError>
Sourcepub async fn export_to_async_writer<W: AsyncWrite + Unpin>(
&self,
writer: &mut W,
format: ExportFormat,
portal_filter: Option<&str>,
limit: Option<usize>,
) -> Result<u64, AppError>
pub async fn export_to_async_writer<W: AsyncWrite + Unpin>( &self, writer: &mut W, format: ExportFormat, portal_filter: Option<&str>, limit: Option<usize>, ) -> Result<u64, AppError>
Exports datasets to an async writer in streaming mode.
This method writes directly to the async writer without buffering the entire dataset in memory, making it suitable for HTTP streaming responses.
§Arguments
writer- The async output writerformat- The export format (JSONL, JSON, or CSV)portal_filter- Optional portal URL to filter bylimit- Optional maximum number of records
§Returns
The number of datasets exported.
Trait Implementations§
Source§impl<S> Clone for ExportService<S>where
S: DatasetStore + Clone,
impl<S> Clone for ExportService<S>where
S: DatasetStore + Clone,
Auto Trait Implementations§
impl<S> Freeze for ExportService<S>where
S: Freeze,
impl<S> RefUnwindSafe for ExportService<S>where
S: RefUnwindSafe,
impl<S> Send for ExportService<S>
impl<S> Sync for ExportService<S>
impl<S> Unpin for ExportService<S>where
S: Unpin,
impl<S> UnwindSafe for ExportService<S>where
S: UnwindSafe,
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 more