pub struct StorageManager {
pub config: StorageConfig,
/* private fields */
}Expand description
Storage manager that coordinates file operations
Fields§
§config: StorageConfigStorage configuration settings
Implementations§
Source§impl StorageManager
impl StorageManager
Sourcepub async fn new(config: StorageConfig) -> Result<Self>
pub async fn new(config: StorageConfig) -> Result<Self>
Create a new storage manager
Sourcepub fn get_file_roller(&self) -> Option<Arc<FileRoller>>
pub fn get_file_roller(&self) -> Option<Arc<FileRoller>>
Get FileRoller instance
Sourcepub async fn get_writer(
&self,
exchange: &str,
symbol: &str,
data_type: &str,
) -> Result<Arc<FileWriter>>
pub async fn get_writer( &self, exchange: &str, symbol: &str, data_type: &str, ) -> Result<Arc<FileWriter>>
Get or create a file writer for the given parameters
Sourcepub async fn write_trade(&self, trade: &TradeRecord) -> Result<()>
pub async fn write_trade(&self, trade: &TradeRecord) -> Result<()>
Write trade data
Sourcepub async fn write_orderbook(&self, orderbook: &OrderBookRecord) -> Result<()>
pub async fn write_orderbook(&self, orderbook: &OrderBookRecord) -> Result<()>
Write orderbook data
Sourcepub async fn get_stats(&self) -> StorageStats
pub async fn get_stats(&self) -> StorageStats
Get storage statistics
Sourcepub fn get_file_rotation_stats(
&self,
) -> Option<FxHashMap<String, ActiveFileInfo>>
pub fn get_file_rotation_stats( &self, ) -> Option<FxHashMap<String, ActiveFileInfo>>
Get file rotation statistics
Sourcepub async fn list_files(
&self,
exchange: Option<&str>,
symbol: Option<&str>,
data_type: Option<&str>,
start_date: Option<SimpleDate>,
end_date: Option<SimpleDate>,
) -> Result<Vec<FileInfo>>
pub async fn list_files( &self, exchange: Option<&str>, symbol: Option<&str>, data_type: Option<&str>, start_date: Option<SimpleDate>, end_date: Option<SimpleDate>, ) -> Result<Vec<FileInfo>>
List files for a given date range
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StorageManager
impl !RefUnwindSafe for StorageManager
impl Send for StorageManager
impl Sync for StorageManager
impl Unpin for StorageManager
impl !UnwindSafe for StorageManager
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