pub struct OptRRData { /* private fields */ }Implementations§
Source§impl OptRRData
impl OptRRData
pub fn new( payload_size: u16, ext_rcode: u8, version: u8, flags: u16, options: IndexMap<OptCodes, Vec<u8>>, ) -> Self
pub fn set_payload_size(&mut self, payload_size: u16)
pub fn get_payload_size(&self) -> u16
pub fn set_ext_rcode(&mut self, ext_rcode: u8)
pub fn get_ext_rcode(&self) -> u8
pub fn set_version(&mut self, version: u8)
pub fn get_version(&self) -> u8
pub fn set_flags(&mut self, flags: u16)
pub fn get_flags(&self) -> u16
pub fn has_option(&mut self, code: &OptCodes) -> bool
pub fn insert_option(&mut self, code: OptCodes, option: Vec<u8>)
pub fn get_option(&self, code: &OptCodes) -> Option<&Vec<u8>>
pub fn get_option_mut(&mut self, code: &OptCodes) -> Option<&mut Vec<u8>>
pub fn get_options(&self) -> impl Iterator<Item = (&OptCodes, &Vec<u8>)>
pub fn get_options_mut( &mut self, ) -> impl Iterator<Item = (&OptCodes, &mut Vec<u8>)>
Trait Implementations§
Source§impl RRData for OptRRData
impl RRData for OptRRData
fn from_bytes(buf: &[u8], off: usize) -> Result<Self, RRDataError>
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>
Auto Trait Implementations§
impl Freeze for OptRRData
impl RefUnwindSafe for OptRRData
impl Send for OptRRData
impl Sync for OptRRData
impl Unpin for OptRRData
impl UnsafeUnpin for OptRRData
impl UnwindSafe for OptRRData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more