pub struct NetPacket<B> { /* private fields */ }
Implementations§
Source§impl<B: AsRef<[u8]>> NetPacket<B>
impl<B: AsRef<[u8]>> NetPacket<B>
Sourcepub unsafe fn new_unchecked(buffer: B) -> NetPacket<B>
pub unsafe fn new_unchecked(buffer: B) -> NetPacket<B>
§Safety
Ensures that the given buffer has enough space
pub fn new(buffer: B) -> Result<NetPacket<B>>
pub fn protocol(&self) -> Result<ProtocolType>
pub fn data_length(&self) -> u16
pub fn max_ttl(&self) -> u8
pub fn ttl(&self) -> u8
pub fn is_encrypt(&self) -> bool
pub fn group_code(&self) -> &[u8] ⓘ
pub fn src_id(&self) -> &[u8] ⓘ
pub fn dest_id(&self) -> &[u8] ⓘ
pub fn payload(&self) -> &[u8] ⓘ
pub fn buffer(&self) -> &[u8] ⓘ
pub fn into_buffer(self) -> B
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for NetPacket<B>where
B: Freeze,
impl<B> RefUnwindSafe for NetPacket<B>where
B: RefUnwindSafe,
impl<B> Send for NetPacket<B>where
B: Send,
impl<B> Sync for NetPacket<B>where
B: Sync,
impl<B> Unpin for NetPacket<B>where
B: Unpin,
impl<B> UnwindSafe for NetPacket<B>where
B: 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