Skip to main content

McapWriteOptions

Struct McapWriteOptions 

Source
pub struct McapWriteOptions { /* private fields */ }
Expand description

Options for use with an McapWriter.

Implementations§

Source§

impl WriteOptions

Source

pub fn new() -> WriteOptions

Source

pub fn compression(self, compression: Option<Compression>) -> WriteOptions

Specifies the compression that should be used on chunks.

Source

pub fn profile<S>(self, profile: S) -> WriteOptions
where S: Into<String>,

Specifies the profile that should be written to the MCAP Header record.

Source

pub fn library<S>(self, library: S) -> WriteOptions
where S: Into<String>,

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn emit_summary_offsets(self, emit_summary_offsets: bool) -> WriteOptions

Specifies whether to write summary offset records. This is on by default.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn compression_level(self, compression_level: u32) -> WriteOptions

Available on crate features zstd or lz4 only.

Specifies the compression level to use. A value of zero instructs the compressor to use the default compression level.

Source

pub fn compression_threads(self, compression_threads: u32) -> WriteOptions

Available on crate feature 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.

Source

pub fn create<W>(self, w: W) -> Result<Writer<W>, McapError>
where W: Write + Seek,

Creates a Writer which writes to w using the given options

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> WriteOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WriteOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for WriteOptions

Source§

fn default() -> WriteOptions

Returns the “default value” for a type. Read more
Source§

impl From<WriteOptions> for McapWriter

Source§

fn from(value: McapWriteOptions) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> SaturatingInto<T> for U
where T: SaturatingFrom<U>,

Source§

fn saturating_into(self) -> T

Performs the conversion.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more