pub trait ComposeRecordData: RecordData {
// Required methods
fn rdlen(&self, compress: bool) -> Option<u16>;
fn compose_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>;
fn compose_canonical_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>;
// Provided methods
fn compose_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError> { ... }
fn compose_canonical_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError> { ... }
}
Expand description
A type of record data that can be composed.
Required Methods§
Sourcefn rdlen(&self, compress: bool) -> Option<u16>
fn rdlen(&self, compress: bool) -> Option<u16>
Returns the length of the record data if available.
The method should return None
, if the length is not known or is not
the same for all targets.
If compress
is true
, name compression is available in the target.
If name compression would be used in compose_rdata
, the method
should None
if compress
is true
since it can’t know the final
size.
Sourcefn compose_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the wire format of the record data into target
.
Sourcefn compose_canonical_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_canonical_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the canonical wire format of the record data into target
.
Provided Methods§
Sourcefn compose_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_len_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the record data prefixed with its length.
Sourcefn compose_canonical_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_canonical_len_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the record data prefixed with its length.
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.