pub trait AsyncEncodeRecordRef {
// Required methods
async fn encode_record_ref(
&mut self,
record_ref: RecordRef<'_>,
) -> Result<()>;
async unsafe fn encode_record_ref_ts_out(
&mut self,
record_ref: RecordRef<'_>,
ts_out: bool,
) -> Result<()>;
// Provided method
async fn encode_record_refs(
&mut self,
record_refs: &[RecordRef<'_>],
) -> Result<()> { ... }
}async only.Expand description
Trait for async encoding of DBN of RecordRef records.
Required Methods§
Sourceasync fn encode_record_ref(&mut self, record_ref: RecordRef<'_>) -> Result<()>
async fn encode_record_ref(&mut self, record_ref: RecordRef<'_>) -> Result<()>
Encodes a single RecordRef.
§Errors
This function returns an error if it’s unable to write to the underlying writer or there’s a serialization error.
§Cancel safety
This method is not cancellation safe. If this method is used in a
tokio::select! statement and another branch completes first, then the
record may have been partially written, but future calls will begin writing the
encoded record from the beginning.
Sourceasync unsafe fn encode_record_ref_ts_out(
&mut self,
record_ref: RecordRef<'_>,
ts_out: bool,
) -> Result<()>
async unsafe fn encode_record_ref_ts_out( &mut self, record_ref: RecordRef<'_>, ts_out: bool, ) -> Result<()>
Encodes a single DBN RecordRef with an optional ts_out (see
record::WithTsOut).
§Safety
ts_out must be false if record does not have an appended ts_out.
§Errors
This function returns an error if it’s unable to write to the underlying writer or there’s a serialization error.
§Cancel safety
This method is not cancellation safe. If this method is used in a
tokio::select! statement and another branch completes first, then the
record may have been partially written, but future calls will begin writing the
encoded record from the beginning.
Provided Methods§
Sourceasync fn encode_record_refs(
&mut self,
record_refs: &[RecordRef<'_>],
) -> Result<()>
async fn encode_record_refs( &mut self, record_refs: &[RecordRef<'_>], ) -> Result<()>
Encodes a slice of RecordRefs.
§Errors
This function returns an error if it’s unable to write to the underlying writer or there’s a serialization error.
§Cancel safety
This method is not cancellation safe. If this method is used in a
tokio::select! statement and another branch completes first, then the
record may have been partially written, but future calls will begin writing the
encoded record from the beginning.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.