pub struct FixedRecordWriter<W: Write> { /* private fields */ }Expand description
Fixed record writer for writing fixed-length records.
Implementations§
Source§impl<W: Write> FixedRecordWriter<W>
impl<W: Write> FixedRecordWriter<W>
Sourcepub fn new(output: W, lrecl: Option<u32>) -> Result<Self>
pub fn new(output: W, lrecl: Option<u32>) -> Result<Self>
Create a new fixed record writer.
§Errors
Returns an error if no LRECL is provided or if it is zero.
Sourcepub fn write_record(&mut self, data: &[u8]) -> Result<()>
pub fn write_record(&mut self, data: &[u8]) -> Result<()>
Write a record and pad with 0x00 to LRECL.
§Errors
Returns an error if the record is longer than LRECL or I/O fails.
Sourcepub fn record_count(&self) -> u64
pub fn record_count(&self) -> u64
Get the current record count.
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for FixedRecordWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for FixedRecordWriter<W>where
W: RefUnwindSafe,
impl<W> Send for FixedRecordWriter<W>where
W: Send,
impl<W> Sync for FixedRecordWriter<W>where
W: Sync,
impl<W> Unpin for FixedRecordWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for FixedRecordWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for FixedRecordWriter<W>where
W: UnwindSafe,
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