pub trait CollatableRecordHeader<B: ConvertiblePrimitiveInteger>: RecordHeader {
// Required methods
fn collate_key(&self) -> B;
fn write_fields<W: Write>(
&self,
writer: &mut W,
_ctx: &<<Self as RecordHeader>::RecordType as MappedRecord>::ParsingContext,
) -> Result<()>;
// Provided method
fn collation_group_key(
&self,
_ctx: &<<Self as RecordHeader>::RecordType as MappedRecord>::ParsingContext,
) -> u64
where u64: From<B> { ... }
}Expand description
This trait specifies that a RecordHeader is collatable by some [B] which can be converted to a primitive integer. For example, the header might be collatable by the barcode, and this trait allows retriving that barcode / key as something convertible to an integer and also allows writing the header out to a stream.
Required Methods§
Sourcefn collate_key(&self) -> B
fn collate_key(&self) -> B
Retreives the key by which this record header (and the coresponding record) can be collated
Sourcefn write_fields<W: Write>(
&self,
writer: &mut W,
_ctx: &<<Self as RecordHeader>::RecordType as MappedRecord>::ParsingContext,
) -> Result<()>
fn write_fields<W: Write>( &self, writer: &mut W, _ctx: &<<Self as RecordHeader>::RecordType as MappedRecord>::ParsingContext, ) -> Result<()>
Writes the header to the provided writer.
Provided Methods§
Sourcefn collation_group_key(
&self,
_ctx: &<<Self as RecordHeader>::RecordType as MappedRecord>::ParsingContext,
) -> u64
fn collation_group_key( &self, _ctx: &<<Self as RecordHeader>::RecordType as MappedRecord>::ParsingContext, ) -> u64
Retrieves the key by which this record header should be grouped into an output chunk during collation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".