[−][src]Struct packet_crafter::Packet
Methods
impl Packet
[src]
pub fn get_selection(&self) -> &HashMap<Protocol, u32>
[src]
impl Packet
[src]
pub fn set_payload(&mut self, v: Vec<u8>)
[src]
impl Packet
[src]
pub fn new(protos: Vec<Protocol>) -> Self
[src]
pub fn new_empty() -> Self
[src]
pub fn add_header(&mut self, buf: impl Header)
[src]
pub fn extend_payload<T: IntoIterator<Item = u8>>(&mut self, buf: T)
[src]
pub fn into_vec(self) -> Vec<u8>
[src]
pub fn parse(raw_data: &[u8]) -> Result<Self, ParseError>
[src]
pub fn get_header_as_slice(&self, p: Protocol) -> Option<&[u8]>
[src]
Returns Some(&u8) if the header is found in this packet, else None
impl Packet
[src]
pub fn get_ip_header(&self) -> Option<Box<IpHeader>>
[src]
pub fn get_arp_header(&self) -> Option<Box<ArpHeader>>
[src]
pub fn get_eth_header(&self) -> Option<Box<EthernetHeader>>
[src]
pub fn get_tcp_header(&self) -> Option<Box<TcpHeader>>
[src]
pub fn get_icmp_header(&self) -> Option<Box<IcmpHeader>>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,