Trait packet::AsPacketMut
[−]
[src]
pub trait AsPacketMut<'a, P: PacketMut + 'a> { fn as_packet_mut(&'a mut self) -> Result<P>; }
A type convertible to a Packet
.
Example
use packet::AsPacketMut; use packet::ether; let mut bytes = [0x00u8, 0x23, 0x69, 0x63, 0x59, 0xbe, 0xe4, 0xb3, 0x18, 0x26, 0x63, 0xa3, 0x08, 0x00]; let mut packet: ether::Packet<_> = bytes.as_packet_mut().unwrap(); assert_eq!(packet.destination(), "00:23:69:63:59:be".parse().unwrap()); packet.set_destination("00:23:42:63:00:be".parse().unwrap()); assert_eq!(packet.destination(), "00:23:42:63:00:be".parse().unwrap());
Required Methods
fn as_packet_mut(&'a mut self) -> Result<P>
Try converting to a packet.
Implementors
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: Buffer> AsPacketMut<'a, Packet<&'a mut [u8]>> for packet::ether::Builder<B>
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Option<&'a mut [u8]>> for B
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: Buffer> AsPacketMut<'a, Packet<&'a mut [u8]>> for packet::ip::v4::Builder<B>
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: Buffer> AsPacketMut<'a, Packet<&'a mut [u8]>> for packet::icmp::echo::Builder<B>
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: Buffer> AsPacketMut<'a, Packet<&'a mut [u8]>> for packet::icmp::information::Builder<B>
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: Buffer> AsPacketMut<'a, Packet<&'a mut [u8]>> for packet::icmp::timestamp::Builder<B>
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Option<&'a mut [u8]>> for B
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: Buffer> AsPacketMut<'a, Packet<&'a mut [u8]>> for packet::tcp::Builder<B>
impl<'a, B: AsRef<[u8]> + AsMut<[u8]>> AsPacketMut<'a, Packet<&'a mut [u8]>> for B
impl<'a, B: Buffer> AsPacketMut<'a, Packet<&'a mut [u8]>> for packet::udp::Builder<B>