Struct capsules_extra::net::udp::UDPHeader
source · 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)