pub trait RRData:
Display
+ Debug
+ Send
+ Sync {
// Required methods
fn from_bytes(buf: &[u8], off: usize) -> Result<Self, RRDataError>
where Self: Sized;
fn to_bytes_compressed(
&self,
compression_data: &mut HashMap<String, usize>,
off: usize,
) -> Result<Vec<u8>, RRDataError>;
fn to_bytes(&self) -> Result<Vec<u8>, RRDataError>;
fn get_type(&self) -> RRTypes;
fn upcast(self) -> Box<dyn RRData>;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn clone_box(&self) -> Box<dyn RRData>;
}Required Methods§
fn from_bytes(buf: &[u8], off: usize) -> Result<Self, RRDataError>where
Self: Sized,
fn to_bytes_compressed( &self, compression_data: &mut HashMap<String, usize>, off: usize, ) -> Result<Vec<u8>, RRDataError>
fn to_bytes(&self) -> Result<Vec<u8>, RRDataError>
fn get_type(&self) -> RRTypes
fn upcast(self) -> Box<dyn RRData>
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn clone_box(&self) -> Box<dyn RRData>
Implementations§
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".