[−][src]Struct jnet::icmp::Message
ICMP Message
Methods
impl<B> Message<B, EchoRequest, Invalid> where
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
[src]
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
impl<B, E, C> Message<B, E, C> where
B: AsSlice<Element = u8>,
E: Echo,
[src]
B: AsSlice<Element = u8>,
E: Echo,
pub fn get_identifier(&self) -> u16
[src]
Returns the Identifier field of the header
pub fn get_sequence_number(&self) -> u16
[src]
Returns the Identifier field of the header
impl<B, E> Message<B, E, Invalid> where
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
E: Echo,
[src]
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
E: Echo,
pub fn set_identifier(&mut self, ident: u16)
[src]
Returns the Identifier field of the header
pub fn set_sequence_number(&mut self, seq_no: u16)
[src]
Returns the Identifier field of the header
impl<B> Message<B, Unknown, Valid> where
B: AsSlice<Element = u8>,
[src]
B: AsSlice<Element = u8>,
impl<B> Message<B, Unknown, Invalid> where
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
[src]
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
pub fn set_type(&mut self, type_: Type)
[src]
Sets the Type field of the header
pub fn set_code(&mut self, code: u8)
[src]
Sets the Code field of the header
impl<B> Message<B, Unknown, Valid> where
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
[src]
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
pub fn set_type(self, type_: Type) -> Message<B, Unknown, Invalid>
[src]
Sets the Type field of the header
pub fn set_code(self, code: u8) -> Message<B, Unknown, Invalid>
[src]
Sets the Code field of the header
impl<B, C> Message<B, Unknown, C> where
B: AsSlice<Element = u8>,
[src]
B: AsSlice<Element = u8>,
pub fn downcast<TYPE>(self) -> Result<Message<B, TYPE, C>, Self> where
Self: TryInto<Message<B, TYPE, C>, Error = Self>,
[src]
Self: TryInto<Message<B, TYPE, C>, Error = Self>,
Downcasts this packet with unknown type into a specific type
impl<B, T, C> Message<B, T, C> where
B: AsSlice<Element = u8>,
[src]
B: AsSlice<Element = u8>,
pub fn get_type(&self) -> Type
[src]
Returns the Type field of the header
pub fn get_code(&self) -> u8
[src]
Returns the Type field of the header
pub fn payload(&self) -> &[u8]
[src]
View into the payload
pub fn len(&self) -> u16
[src]
Returns the length (header + data) of this packet
pub fn as_bytes(&self) -> &[u8]
[src]
Returns the byte representation of this packet
impl<B, T> Message<B, T, Invalid> where
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
[src]
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
pub fn payload_mut(&mut self) -> &mut [u8]
[src]
Mutable view into the payload
pub fn update_checksum(self) -> Message<B, T, Valid>
[src]
Updates the Checksum field of the header
Trait Implementations
impl<B, C> From<Message<B, EchoRequest, C>> for Message<B, EchoReply, Valid> where
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
[src]
B: AsSlice<Element = u8> + AsMutSlice<Element = u8>,
fn from(p: Message<B, EchoRequest, C>) -> Self
[src]
impl<B, E, C> Debug for Message<B, E, C> where
B: AsSlice<Element = u8>,
E: Echo,
[src]
B: AsSlice<Element = u8>,
E: Echo,
NOTE excludes the payload
impl<B, C> Debug for Message<B, Unknown, C> where
B: AsSlice<Element = u8>,
[src]
B: AsSlice<Element = u8>,
impl<B, T, C> Clone for Message<B, T, C> where
B: AsSlice<Element = u8> + Clone,
[src]
B: AsSlice<Element = u8> + Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<BUFFER, TYPE, CHECKSUM> Unpin for Message<BUFFER, TYPE, CHECKSUM> where
BUFFER: Unpin,
CHECKSUM: Unpin,
TYPE: Unpin,
BUFFER: Unpin,
CHECKSUM: Unpin,
TYPE: Unpin,
impl<BUFFER, TYPE, CHECKSUM> Send for Message<BUFFER, TYPE, CHECKSUM> where
BUFFER: Send,
CHECKSUM: Send,
TYPE: Send,
BUFFER: Send,
CHECKSUM: Send,
TYPE: Send,
impl<BUFFER, TYPE, CHECKSUM> Sync for Message<BUFFER, TYPE, CHECKSUM> where
BUFFER: Sync,
CHECKSUM: Sync,
TYPE: Sync,
BUFFER: Sync,
CHECKSUM: Sync,
TYPE: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self