capsules_extra::net::udp::udp_send

Struct 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>

Source

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>

Source§

fn next(&'a self) -> &'a ListLink<'a, UDPSendStruct<'a, T>>

Source§

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)

This function sets the client for the UDPSender instance Read more
Source§

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

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

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

fn get_binding(&self) -> Option<UdpPortBindingTx>

Source§

fn is_bound(&self) -> bool

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.