pub struct DataFileWriter { /* private fields */ }Expand description
Writer for processed data output.
Writes processed neutron data to files in various formats.
Implementations§
Source§impl DataFileWriter
impl DataFileWriter
Sourcepub fn write_neutrons_csv(&mut self, neutrons: &[Neutron]) -> Result<()>
pub fn write_neutrons_csv(&mut self, neutrons: &[Neutron]) -> Result<()>
Sourcepub fn write_neutrons_binary(&mut self, neutrons: &[Neutron]) -> Result<()>
pub fn write_neutrons_binary(&mut self, neutrons: &[Neutron]) -> Result<()>
Writes neutrons as binary data.
Format per neutron: f64 (x) + f64 (y) + u32 (tof) + u16 (tot)
u16(n_hits) +u8(chip_id) + 3 reserved bytes.
Total: 28 bytes per neutron.
§Errors
Returns an error if writing to the underlying file fails.
Sourcepub fn write_neutron_batch_csv(
&mut self,
batch: &NeutronBatch,
include_header: bool,
) -> Result<()>
pub fn write_neutron_batch_csv( &mut self, batch: &NeutronBatch, include_header: bool, ) -> Result<()>
Sourcepub fn write_neutron_batch_binary(&mut self, batch: &NeutronBatch) -> Result<()>
pub fn write_neutron_batch_binary(&mut self, batch: &NeutronBatch) -> Result<()>
Writes neutron batch as binary data.
§Errors
Returns an error if writing to the underlying file fails.
Auto Trait Implementations§
impl Freeze for DataFileWriter
impl RefUnwindSafe for DataFileWriter
impl Send for DataFileWriter
impl Sync for DataFileWriter
impl Unpin for DataFileWriter
impl UnwindSafe for DataFileWriter
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 more