pub struct Packet<T: Table> { /* private fields */ }
Expand description
Packed, encryptable UTF table
Implementations§
Source§impl<T: Table> Packet<T>
impl<T: Table> Packet<T>
Sourcepub fn new(prefix: &'static [u8; 4]) -> Self
pub fn new(prefix: &'static [u8; 4]) -> Self
Creates a new UTF table packet with the given prefix
The table itself is initialized with T::new()
Sourcepub fn from_table(table: T, prefix: &'static [u8; 4]) -> Self
pub fn from_table(table: T, prefix: &'static [u8; 4]) -> Self
Creates a new UTF table packet with the given prefix
Sourcepub fn read_packet(
reader: &mut dyn Read,
prefix: &'static [u8; 4],
) -> Result<Self>
pub fn read_packet( reader: &mut dyn Read, prefix: &'static [u8; 4], ) -> Result<Self>
Reads a UTF table packet from the given stream, verifying that it has the given 4-byte prefix.
Sourcepub fn write_packet(&self, writer: &mut dyn Write) -> Result<()>
pub fn write_packet(&self, writer: &mut dyn Write) -> Result<()>
Writes a UTF table packet to the given stream.
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Returns whether or not the table is encrypted
Sourcepub fn disable_encryption(&mut self)
pub fn disable_encryption(&mut self)
Disables encryption for this packet
Sourcepub fn enable_encryption(&mut self)
pub fn enable_encryption(&mut self)
Enables encryption for this packet
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Packet<T>where
T: Freeze,
impl<T> RefUnwindSafe for Packet<T>where
T: RefUnwindSafe,
impl<T> Send for Packet<T>where
T: Send,
impl<T> Sync for Packet<T>where
T: Sync,
impl<T> Unpin for Packet<T>where
T: Unpin,
impl<T> UnwindSafe for Packet<T>where
T: 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