pub trait WriteSeekExt: Write + Seek {
// Required method
fn write_all_at_preserving_position(
&mut self,
offset: u64,
buffer: &[u8],
) -> Result<()>;
}Expand description
Required Methods§
Sourcefn write_all_at_preserving_position(
&mut self,
offset: u64,
buffer: &[u8],
) -> Result<()>
fn write_all_at_preserving_position( &mut self, offset: u64, buffer: &[u8], ) -> Result<()>
Writes all bytes at offset and restores the original position.
This method seeks to offset, delegates to Write::write_all, and
then restores the position that was current before the call.
§Parameters
offset: Absolute byte offset from the start of the stream.buffer: Bytes to write.
§Errors
Returns an error when reading the current position, seeking to offset,
writing bytes, or restoring the original position fails. If restoration
fails, the restoration error is returned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".