pub struct FileWriter { /* private fields */ }Expand description
File writer for market data with real-time compression
Implementations§
Source§impl FileWriter
impl FileWriter
Sourcepub async fn new(file_path: PathBuf, config: StorageConfig) -> Result<Self>
pub async fn new(file_path: PathBuf, config: StorageConfig) -> Result<Self>
Create a new file writer with real-time compression
Sourcepub async fn new_with_compression(
file_path: PathBuf,
config: StorageConfig,
compression_mode: CompressionMode,
) -> Result<Self>
pub async fn new_with_compression( file_path: PathBuf, config: StorageConfig, compression_mode: CompressionMode, ) -> Result<Self>
Create a new file writer with specified compression mode
Sourcepub async fn write_trade(&self, trade: &TradeRecord) -> Result<()>
pub async fn write_trade(&self, trade: &TradeRecord) -> Result<()>
Write a trade record with real-time compression
Sourcepub async fn write_orderbook(&self, orderbook: &OrderBookRecord) -> Result<()>
pub async fn write_orderbook(&self, orderbook: &OrderBookRecord) -> Result<()>
Write an orderbook record with real-time compression
Sourcepub const fn compression_mode(&self) -> CompressionMode
pub const fn compression_mode(&self) -> CompressionMode
Get compression mode
Trait Implementations§
Source§impl Debug for FileWriter
impl Debug for FileWriter
Auto Trait Implementations§
impl Freeze for FileWriter
impl !RefUnwindSafe for FileWriter
impl Send for FileWriter
impl Sync for FileWriter
impl Unpin for FileWriter
impl !UnwindSafe for FileWriter
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