pub struct FileOps { /* private fields */ }Expand description
File query operations
Implementations§
Source§impl FileOps
impl FileOps
Sourcepub fn read_file(
&self,
path: &Path,
format: FileFormat,
csv_config: &CsvConfig,
) -> Result<Vec<JsonValue>>
pub fn read_file( &self, path: &Path, format: FileFormat, csv_config: &CsvConfig, ) -> Result<Vec<JsonValue>>
Read records from a file
Sourcepub fn query_file(
&self,
path: &Path,
query: &str,
format: FileFormat,
csv_config: &CsvConfig,
) -> Result<Vec<JsonValue>>
pub fn query_file( &self, path: &Path, query: &str, format: FileFormat, csv_config: &CsvConfig, ) -> Result<Vec<JsonValue>>
Query a file with a TQL query
Sourcepub fn query_file_enriched(
&self,
path: &Path,
query: &str,
format: FileFormat,
csv_config: &CsvConfig,
) -> Result<Vec<JsonValue>>
pub fn query_file_enriched( &self, path: &Path, query: &str, format: FileFormat, csv_config: &CsvConfig, ) -> Result<Vec<JsonValue>>
Query a file with enrichment (applies mutators to results)
Sourcepub fn query_file_stats(
&self,
path: &Path,
query: &str,
format: FileFormat,
csv_config: &CsvConfig,
) -> Result<JsonValue>
pub fn query_file_stats( &self, path: &Path, query: &str, format: FileFormat, csv_config: &CsvConfig, ) -> Result<JsonValue>
Execute stats query on a file
Sourcepub fn query_folder(
&self,
folder_path: &Path,
query: &str,
pattern: &str,
format: FileFormat,
csv_config: &CsvConfig,
parallel: bool,
) -> Result<Vec<JsonValue>>
pub fn query_folder( &self, folder_path: &Path, query: &str, pattern: &str, format: FileFormat, csv_config: &CsvConfig, parallel: bool, ) -> Result<Vec<JsonValue>>
Query multiple files in a folder
Sourcepub fn query_folder_stats(
&self,
folder_path: &Path,
query: &str,
pattern: &str,
format: FileFormat,
csv_config: &CsvConfig,
) -> Result<JsonValue>
pub fn query_folder_stats( &self, folder_path: &Path, query: &str, pattern: &str, format: FileFormat, csv_config: &CsvConfig, ) -> Result<JsonValue>
Query folder with stats aggregation
Sourcepub fn stream_file(
&self,
path: &Path,
format: FileFormat,
) -> Result<Box<dyn Iterator<Item = Result<JsonValue>>>>
pub fn stream_file( &self, path: &Path, format: FileFormat, ) -> Result<Box<dyn Iterator<Item = Result<JsonValue>>>>
Streaming file reader - returns an iterator over records
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileOps
impl RefUnwindSafe for FileOps
impl Send for FileOps
impl Sync for FileOps
impl Unpin for FileOps
impl UnsafeUnpin for FileOps
impl UnwindSafe for FileOps
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> 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