Struct packet_formats::udp::UdpPacketBuilder
source · pub struct UdpPacketBuilder<A: IpAddress> { /* private fields */ }
Expand description
A builder for UDP packets.
Implementations§
source§impl<A: IpAddress> UdpPacketBuilder<A>
impl<A: IpAddress> UdpPacketBuilder<A>
sourcepub fn new(
src_ip: A,
dst_ip: A,
src_port: Option<NonZeroU16>,
dst_port: NonZeroU16
) -> UdpPacketBuilder<A>
pub fn new( src_ip: A, dst_ip: A, src_port: Option<NonZeroU16>, dst_port: NonZeroU16 ) -> UdpPacketBuilder<A>
Constructs a new UdpPacketBuilder
.
sourcepub fn src_port(&self) -> Option<NonZeroU16>
pub fn src_port(&self) -> Option<NonZeroU16>
Returns the source port for the builder.
sourcepub fn dst_port(&self) -> Option<NonZeroU16>
pub fn dst_port(&self) -> Option<NonZeroU16>
Returns the destination port for the builder.
Trait Implementations§
source§impl<A: Clone + IpAddress> Clone for UdpPacketBuilder<A>
impl<A: Clone + IpAddress> Clone for UdpPacketBuilder<A>
source§fn clone(&self) -> UdpPacketBuilder<A>
fn clone(&self) -> UdpPacketBuilder<A>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<A: IpAddress> PacketBuilder for UdpPacketBuilder<A>
impl<A: IpAddress> PacketBuilder for UdpPacketBuilder<A>
impl<A: Copy + IpAddress> Copy for UdpPacketBuilder<A>
Auto Trait Implementations§
impl<A> Freeze for UdpPacketBuilder<A>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + Freeze,
impl<A> RefUnwindSafe for UdpPacketBuilder<A>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + RefUnwindSafe,
impl<A> Send for UdpPacketBuilder<A>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static,
impl<A> Sync for UdpPacketBuilder<A>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static,
impl<A> Unpin for UdpPacketBuilder<A>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + Unpin,
impl<A> UnwindSafe for UdpPacketBuilder<A>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + UnwindSafe,
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