Struct bantamweight::BinaryStream
source · [−]pub struct BinaryStream {
pub mode: BinaryStreamMode,
/* private fields */
}
Fields
mode: BinaryStreamMode
Implementations
sourceimpl BinaryStream
impl BinaryStream
pub fn new() -> BinaryStream
pub fn with_capacity(expected_size: usize) -> BinaryStream
pub fn from_buffer(buffer: VecDeque<u8>) -> BinaryStream
pub fn from_bytes(bytes: &[u8]) -> BinaryStream
pub fn size(&self) -> usize
pub fn get_buffer(self) -> VecDeque<u8>
pub fn get_buffer_vec(self) -> Vec<u8>
pub fn get_buffer_clone(&self) -> VecDeque<u8>
pub fn get_buffer_vec_clone(&self) -> Vec<u8>
pub fn write_bool(&mut self, val: bool) -> Result<()>
pub fn write_u16(&mut self, val: u16) -> Result<()>
pub fn write_u32(&mut self, val: u32) -> Result<()>
pub fn write_u64(&mut self, val: u64) -> Result<()>
pub fn write_u128(&mut self, val: u128) -> Result<()>
pub fn write_i64(&mut self, val: i64) -> Result<()>
pub fn write_string(&mut self, val: &String) -> Result<()>
pub fn write_byte_vec(&mut self, val: &Vec<u8>) -> Result<()>
pub fn write_vec<T: Serializable>(&mut self, val: &Vec<T>) -> Result<()>
pub fn write_packet_type<T: PacketType>(&mut self, val: T) -> Result<()>
pub fn write_buffer_size(&mut self) -> Result<()>
pub fn read_bool(&mut self) -> Result<bool>
pub fn read_u16(&mut self) -> Result<u16>
pub fn read_u32(&mut self) -> Result<u32>
pub fn read_u64(&mut self) -> Result<u64>
pub fn read_u128(&mut self) -> Result<u128>
pub fn read_i64(&mut self) -> Result<i64>
pub fn read_string(&mut self) -> Result<String>
pub fn read_byte_vec(&mut self) -> Result<Vec<u8>>
pub fn read_vec<T: Serializable>(&mut self) -> Result<Vec<T>>
pub fn read_packet_type<T: PacketType>(&mut self) -> Result<T>
pub fn read_buffer_size(&mut self) -> Result<u32>
pub fn write_buffer_single(&mut self, byte: u8) -> Result<()>
pub fn write_buffer(&mut self, bytes: &Vec<u8>) -> Result<()>
pub fn write_buffer_slice(&mut self, bytes: &[u8]) -> Result<()>
pub fn read_buffer_single(&mut self) -> Result<u8>
pub fn read_buffer(&mut self, count: usize) -> Result<Vec<u8>>
Auto Trait Implementations
impl RefUnwindSafe for BinaryStream
impl Send for BinaryStream
impl Sync for BinaryStream
impl Unpin for BinaryStream
impl UnwindSafe for BinaryStream
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more