pub struct ChunkedWriter {
pub path: String,
pub frame_count: usize,
pub chunk_size: usize,
}Expand description
Streaming binary writer for large simulation data sets.
Each call to write_chunk appends a serialised
SimulationChunk to the output file.
Fields§
§path: StringPath to the output file.
frame_count: usizeNumber of frames written so far.
chunk_size: usizeMaximum particles per chunk (advisory; not enforced).
Implementations§
Source§impl ChunkedWriter
impl ChunkedWriter
Sourcepub fn new(path: impl Into<String>, chunk_size: usize) -> Self
pub fn new(path: impl Into<String>, chunk_size: usize) -> Self
Create a new writer targeting path with advisory chunk_size.
Sourcepub fn write_chunk(&mut self, chunk: &SimulationChunk) -> Result<(), String>
pub fn write_chunk(&mut self, chunk: &SimulationChunk) -> Result<(), String>
Append chunk to the file.
Returns an error string on I/O failure.
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Number of frames written.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChunkedWriter
impl RefUnwindSafe for ChunkedWriter
impl Send for ChunkedWriter
impl Sync for ChunkedWriter
impl Unpin for ChunkedWriter
impl UnsafeUnpin for ChunkedWriter
impl UnwindSafe for ChunkedWriter
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.