pub struct TofPacketWriter {
pub file: File,
pub file_path: String,
pub pkts_per_file: usize,
pub mbytes_per_file: usize,
pub file_type: FileType,
pub file_name: String,
/* private fields */
}
Expand description
Write TofPackets to disk.
Operates sequentially, packets 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_type: FileType
add timestamps to filenames
file_name: String
Implementations§
Source§impl TofPacketWriter
impl TofPacketWriter
Sourcepub fn new(file_path: String, file_type: FileType) -> Self
pub fn new(file_path: String, file_type: FileType) -> Self
Instantiate a new PacketWriter
§Arguments
- file_prefix : Prefix file with this string. A continuous number will get appended to control the file size.
- file_type : control the behaviour of how the filename is assigned.
pub fn get_file(&self) -> File
Sourcepub fn add_tof_packet(&mut self, packet: &TofPacket)
pub fn add_tof_packet(&mut self, packet: &TofPacket)
Induce serialization to disk for a TofPacket
Trait Implementations§
Source§impl Default for TofPacketWriter
impl Default for TofPacketWriter
Source§fn default() -> TofPacketWriter
fn default() -> TofPacketWriter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TofPacketWriter
impl RefUnwindSafe for TofPacketWriter
impl Send for TofPacketWriter
impl Sync for TofPacketWriter
impl Unpin for TofPacketWriter
impl UnwindSafe for TofPacketWriter
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> 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 moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more