pub struct UDPHeader { /* private fields */ }
Expand description
The UDPHeader
struct follows the layout for the UDP packet header.
Note that the implementation of this struct provides getters and setters for the various fields of the header, to avoid confusion with endian-ness.
Implementations§
Source§impl UDPHeader
impl UDPHeader
pub fn new() -> UDPHeader
pub fn get_offset(&self) -> usize
pub fn set_dst_port(&mut self, port: u16)
pub fn set_src_port(&mut self, port: u16)
pub fn set_len(&mut self, len: u16)
pub fn set_cksum(&mut self, cksum: u16)
pub fn get_src_port(&self) -> u16
pub fn get_dst_port(&self) -> u16
pub fn get_len(&self) -> u16
pub fn get_cksum(&self) -> u16
pub fn get_hdr_size(&self) -> usize
Trait Implementations§
impl Copy for UDPHeader
Auto Trait Implementations§
impl Freeze for UDPHeader
impl RefUnwindSafe for UDPHeader
impl Send for UDPHeader
impl Sync for UDPHeader
impl Unpin for UDPHeader
impl UnwindSafe for UDPHeader
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