Struct capsules_extra::net::udp::udp_send::UDPSendStruct
source · pub struct UDPSendStruct<'a, T: IP6Sender<'a>> { /* private fields */ }
Expand description
This is a specific instantiation of the UDPSender
trait. Note
that this struct contains a reference to an IP6Sender
which it
forwards packets to (and receives callbacks from).
Implementations§
source§impl<'a, T: IP6Sender<'a>> UDPSendStruct<'a, T>
impl<'a, T: IP6Sender<'a>> UDPSendStruct<'a, T>
pub fn new( udp_mux_sender: &'a MuxUdpSender<'a, T>, udp_vis: &'static UdpVisibilityCapability, ) -> UDPSendStruct<'a, T>
Trait Implementations§
source§impl<'a, T: IP6Sender<'a>> ListNode<'a, UDPSendStruct<'a, T>> for UDPSendStruct<'a, T>
impl<'a, T: IP6Sender<'a>> ListNode<'a, UDPSendStruct<'a, T>> for UDPSendStruct<'a, T>
fn next(&'a self) -> &'a ListLink<'a, UDPSendStruct<'a, T>>
source§impl<'a, T: IP6Sender<'a>> UDPSender<'a> for UDPSendStruct<'a, T>
impl<'a, T: IP6Sender<'a>> UDPSender<'a> for UDPSendStruct<'a, T>
Below is the implementation of the UDPSender
traits for the
UDPSendStruct
.
source§fn set_client(&self, client: &'a dyn UDPSendClient)
fn set_client(&self, client: &'a dyn UDPSendClient)
This function sets the client for the
UDPSender
instance Read moresource§fn send_to(
&'a self,
dest: IPAddr,
dst_port: u16,
buf: SubSliceMut<'static, u8>,
net_cap: &'static NetworkCapability,
) -> Result<(), SubSliceMut<'static, u8>>
fn send_to( &'a self, dest: IPAddr, dst_port: u16, buf: SubSliceMut<'static, u8>, net_cap: &'static NetworkCapability, ) -> Result<(), SubSliceMut<'static, u8>>
This function constructs a
UDPHeader
and sends the payload to the
provided destination IP address and
destination port from the src port contained in the UdpPortBindingTx. Read moresource§fn driver_send_to(
&'a self,
dest: IPAddr,
dst_port: u16,
src_port: u16,
buf: SubSliceMut<'static, u8>,
_driver_send_cap: &dyn UdpDriverCapability,
net_cap: &'static NetworkCapability,
) -> Result<(), SubSliceMut<'static, u8>>
fn driver_send_to( &'a self, dest: IPAddr, dst_port: u16, src_port: u16, buf: SubSliceMut<'static, u8>, _driver_send_cap: &dyn UdpDriverCapability, net_cap: &'static NetworkCapability, ) -> Result<(), SubSliceMut<'static, u8>>
This function is identical to
send_to()
except that it takes in
an explicit src_port instead of a binding. This allows it to be used
by the userspace driver, above which apps are bound to multiple ports Read moresource§fn send(
&'a self,
dest: IPAddr,
udp_header: UDPHeader,
buf: SubSliceMut<'static, u8>,
net_cap: &'static NetworkCapability,
) -> Result<(), SubSliceMut<'static, u8>>
fn send( &'a self, dest: IPAddr, udp_header: UDPHeader, buf: SubSliceMut<'static, u8>, net_cap: &'static NetworkCapability, ) -> Result<(), SubSliceMut<'static, u8>>
This function constructs an IP packet from the completed
UDPHeader
and buffer, and sends it to the provided IP address Read morefn get_binding(&self) -> Option<UdpPortBindingTx>
fn is_bound(&self) -> bool
fn set_binding(&self, binding: UdpPortBindingTx) -> Option<UdpPortBindingTx>
Auto Trait Implementations§
impl<'a, T> !Freeze for UDPSendStruct<'a, T>
impl<'a, T> !RefUnwindSafe for UDPSendStruct<'a, T>
impl<'a, T> !Send for UDPSendStruct<'a, T>
impl<'a, T> !Sync for UDPSendStruct<'a, T>
impl<'a, T> Unpin for UDPSendStruct<'a, T>
impl<'a, T> !UnwindSafe for UDPSendStruct<'a, T>
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