pub struct McapWriteOptions { /* private fields */ }Expand description
Options for use with an McapWriter.
Implementations§
Source§impl WriteOptions
impl WriteOptions
pub fn new() -> WriteOptions
Sourcepub fn compression(self, compression: Option<Compression>) -> WriteOptions
pub fn compression(self, compression: Option<Compression>) -> WriteOptions
Specifies the compression that should be used on chunks.
Sourcepub fn profile<S>(self, profile: S) -> WriteOptions
pub fn profile<S>(self, profile: S) -> WriteOptions
Specifies the profile that should be written to the MCAP Header record.
Sourcepub fn library<S>(self, library: S) -> WriteOptions
pub fn library<S>(self, library: S) -> WriteOptions
Specifies the library that should be written to the MCAP Header record.
This is a free-form string that can be used to identify the library that wrote the file. It is not used for any other purpose.
Sourcepub fn chunk_size(self, chunk_size: Option<u64>) -> WriteOptions
pub fn chunk_size(self, chunk_size: Option<u64>) -> WriteOptions
Specifies the target uncompressed size of each chunk.
Messages will be written to chunks until the uncompressed chunk is larger than the
target chunk size, at which point the chunk will be closed and a new one started.
If None, chunks will not be automatically closed and the user must call flush() to
begin a new chunk.
Sourcepub fn use_chunks(self, use_chunks: bool) -> WriteOptions
pub fn use_chunks(self, use_chunks: bool) -> WriteOptions
Specifies whether to use chunks for storing messages.
If false, messages will be written directly to the data section of the file.
This prevents using compression or indexing, but may be useful on small embedded systems
that cannot afford the memory overhead of storing chunk metadata for the entire recording.
Note that it’s often useful to post-process a non-chunked file using mcap recover to add
indexes for efficient processing.
Sourcepub fn disable_seeking(self, disable_seeking: bool) -> WriteOptions
pub fn disable_seeking(self, disable_seeking: bool) -> WriteOptions
Specifies whether the writer should seek or not.
Setting true will allow you to use NoSeek on the destination writer to support
writing to a stream that does not support Seek.
By default the writer will seek the output to avoid buffering in memory. Seeking is an
optimization and should only be disabled if the output is using NoSeek.
Sourcepub fn emit_summary_records(self, value: bool) -> WriteOptions
pub fn emit_summary_records(self, value: bool) -> WriteOptions
Specifies in whether to write any records to the summary section.
If you want only want to include specific record types in the summary section, call this
method with false and then enable the records you want. This ensures that no unwanted
summary records will be written if the format changes in the future.
Note that this does not control whether summary offset records are written, because they are not part of the summary section.
Sourcepub fn emit_summary_offsets(self, emit_summary_offsets: bool) -> WriteOptions
pub fn emit_summary_offsets(self, emit_summary_offsets: bool) -> WriteOptions
Specifies whether to write summary offset records. This is on by default.
Sourcepub fn emit_statistics(self, emit_statistics: bool) -> WriteOptions
pub fn emit_statistics(self, emit_statistics: bool) -> WriteOptions
Specifies whether to write a statistics record in the summary section. This is on by default.
Sourcepub fn emit_message_indexes(self, emit_message_indexes: bool) -> WriteOptions
pub fn emit_message_indexes(self, emit_message_indexes: bool) -> WriteOptions
Specifies whether to write message index records after each chunk. This is on by default.
Sourcepub fn emit_chunk_indexes(self, emit_chunk_indexes: bool) -> WriteOptions
pub fn emit_chunk_indexes(self, emit_chunk_indexes: bool) -> WriteOptions
Specifies whether to write chunk index records in the summary section. This is on by default.
Sourcepub fn emit_attachment_indexes(
self,
emit_attachment_indexes: bool,
) -> WriteOptions
pub fn emit_attachment_indexes( self, emit_attachment_indexes: bool, ) -> WriteOptions
Specifies whether to write attachment index records in the summary section. This is on by default.
Sourcepub fn emit_metadata_indexes(self, emit_metadata_indexes: bool) -> WriteOptions
pub fn emit_metadata_indexes(self, emit_metadata_indexes: bool) -> WriteOptions
Specifies whether to write metadata index records in the summary section. This is on by default.
Sourcepub fn repeat_channels(self, repeat_channels: bool) -> WriteOptions
pub fn repeat_channels(self, repeat_channels: bool) -> WriteOptions
Specifies whether to repeat each channel record from the data section in the summary section. This is on by default.
Sourcepub fn repeat_schemas(self, repeat_schemas: bool) -> WriteOptions
pub fn repeat_schemas(self, repeat_schemas: bool) -> WriteOptions
Specifies whether to repeat each schema record from the data section in the summary section. This is on by default.
Sourcepub fn compression_level(self, compression_level: u32) -> WriteOptions
Available on crate features zstd or lz4 only.
pub fn compression_level(self, compression_level: u32) -> WriteOptions
zstd or lz4 only.Specifies the compression level to use. A value of zero instructs the compressor to use the default compression level.
Sourcepub fn compression_threads(self, compression_threads: u32) -> WriteOptions
Available on crate feature zstd only.
pub fn compression_threads(self, compression_threads: u32) -> WriteOptions
zstd only.Specifies how many threads to use for compression. A value of zero disables multithreaded compression. The default number of threads is equal to the number of physical CPUs.
Sourcepub fn create<W>(self, w: W) -> Result<Writer<W>, McapError>
pub fn create<W>(self, w: W) -> Result<Writer<W>, McapError>
Creates a Writer which writes to w using the given options
Sourcepub fn calculate_chunk_crcs(self, calculate_chunk_crcs: bool) -> WriteOptions
pub fn calculate_chunk_crcs(self, calculate_chunk_crcs: bool) -> WriteOptions
Specifies whether to calculate and write CRCs for chunk records. This is on by default.
Sourcepub fn calculate_data_section_crc(
self,
calculate_data_section_crc: bool,
) -> WriteOptions
pub fn calculate_data_section_crc( self, calculate_data_section_crc: bool, ) -> WriteOptions
Specifies whether to calculate and write a data section CRC into the DataEnd record. This is on by default.
Sourcepub fn calculate_summary_section_crc(
self,
calculate_summary_section_crc: bool,
) -> WriteOptions
pub fn calculate_summary_section_crc( self, calculate_summary_section_crc: bool, ) -> WriteOptions
Specifies whether to calculate and write a summary section CRC into the Footer record. This is on by default.
Sourcepub fn calculate_attachment_crcs(
self,
calculate_attachment_crcs: bool,
) -> WriteOptions
pub fn calculate_attachment_crcs( self, calculate_attachment_crcs: bool, ) -> WriteOptions
Specifies whether to calculate and write a CRC for attachments. This is on by default.
Trait Implementations§
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
Source§fn clone(&self) -> WriteOptions
fn clone(&self) -> WriteOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more