Skip to main content

RRData

Trait RRData 

Source
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§

Source

fn from_bytes(buf: &[u8], off: usize) -> Result<Self, RRDataError>
where Self: Sized,

Source

fn to_bytes_compressed( &self, compression_data: &mut HashMap<String, usize>, off: usize, ) -> Result<Vec<u8>, RRDataError>

Source

fn to_bytes(&self) -> Result<Vec<u8>, RRDataError>

Source

fn get_type(&self) -> RRTypes

Source

fn upcast(self) -> Box<dyn RRData>

Source

fn as_any(&self) -> &dyn Any

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Source

fn clone_box(&self) -> Box<dyn RRData>

Implementations§

Source§

impl dyn RRData

Source

pub fn new(_type: RRTypes, class: &RRClasses) -> Option<Box<dyn RRData>>

Source

pub fn from_wire( _type: RRTypes, class: &RRClasses, buf: &[u8], off: usize, ) -> Result<Box<dyn RRData>, RRDataError>

Trait Implementations§

Source§

impl Clone for Box<dyn RRData>

Source§

fn clone(&self) -> Box<dyn RRData>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§