pub struct CRWriter {
pub file: File,
pub file_path: String,
pub pkts_per_file: usize,
pub mbytes_per_file: usize,
pub file_name: String,
pub run_id: u32,
pub file_timestamp: Option<String>,
/* private fields */
}
Expand description
Write CRFrames to disk.
Operates sequentially, frames can be added one at a time, then will be synced to disk.
Fields§
§file: File
§file_path: String
location to store the file
pkts_per_file: usize
The maximum number of packets for a single file. Ater this number is reached, a new file is started.
mbytes_per_file: usize
The maximum number of (Mega)bytes per file. After this a new file is started
file_name: String
§run_id: u32
§file_timestamp: Option<String>
it can also take a timestamp, in case we don’t want to use the current time when the file is written
Implementations§
Source§impl CRWriter
impl CRWriter
Sourcepub fn new(
file_path: String,
run_id: u32,
subrun_id: Option<u64>,
timestamp: Option<String>,
) -> Self
pub fn new( file_path: String, run_id: u32, subrun_id: Option<u64>, timestamp: Option<String>, ) -> Self
Instantiate a new PacketWriter
§Arguments
- file_path : Path to store the file under
- run_id : Run ID for this file (will be written in filename)
- subrun_id : Sub-Run ID for this file (will be written in filename. If None, a generic “0” will be used
- timestamp : The writer will add an automatic timestamp to the current file based on the current time. This option allows to overwrite that behaviour
pub fn get_file(&self, timestamp: Option<String>) -> File
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CRWriter
impl RefUnwindSafe for CRWriter
impl Send for CRWriter
impl Sync for CRWriter
impl Unpin for CRWriter
impl UnwindSafe for CRWriter
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