pub struct DataStream { /* private fields */ }
Expand description

| Double ended buffer combining vector | and stream-like interfaces. >> and | << read and write unformatted data using | the above serialization templates. | | Fills with data in linear time; some | stringstream implementations take | N^2 time. |

Implementations§

source§

impl DataStream

source

pub fn new(n_type_in: i32, n_version_in: i32) -> Self

source

pub fn new_with_slice(sp: &[u8], n_type_in: i32, n_version_in: i32) -> Self

source

pub fn new_with_args<Args>( n_type_in: i32, n_version_in: i32, args: Args ) -> Self

source

pub fn str_(&self) -> String

source

pub fn begin(&self) -> Box<dyn Iterator<Item = u8>>

source

pub fn begin_mut(&mut self) -> Box<dyn Iterator<Item = u8>>

source

pub fn end(&self) -> Box<dyn Iterator<Item = u8>>

source

pub fn end_mut(&mut self) -> Box<dyn Iterator<Item = u8>>

source

pub fn size(&self) -> usize

source

pub fn empty(&self) -> bool

source

pub fn resize(&mut self, n: usize, c: Option<u8>)

source

pub fn reserve(&mut self, n: usize)

source

pub fn clear(&mut self)

source

pub fn insert_item( &mut self, it: Box<dyn Iterator<Item = u8>>, x: u8 ) -> Box<dyn Iterator<Item = u8>>

source

pub fn insert_multi( &mut self, it: Box<dyn Iterator<Item = u8>>, n: usize, x: u8 )

source

pub fn as_slice(&self) -> &[u8]

source

pub fn as_mut_slice(&mut self) -> &mut [u8]

source

pub fn data_mut(&mut self) -> *mut u8

source

pub fn data(&self) -> *const u8

source

pub fn insert_with_iterator_range( &mut self, it: Box<dyn Iterator<Item = u8>>, first: Box<dyn Iterator<Item = u8>>, last: Box<dyn Iterator<Item = u8>> )

source

pub fn insert_with_pointer_range( &mut self, it: Box<dyn Iterator<Item = u8>>, first: *const u8, last: *const u8 )

source

pub fn erase( &mut self, it: Box<dyn Iterator<Item = u8>> ) -> Box<dyn Iterator<Item = u8>>

source

pub fn erase_range( &mut self, first: Box<dyn Iterator<Item = u8>>, last: Box<dyn Iterator<Item = u8>> ) -> Box<dyn Iterator<Item = u8>>

source

pub fn compact(&mut self)

source

pub fn rewind(&mut self, n: Option<usize>) -> bool

source

pub fn eof(&self) -> bool

source

pub fn rdbuf(&mut self) -> *mut DataStream

source

pub fn in_avail(&self) -> i32

source

pub fn set_type(&mut self, n: i32)

source

pub fn get_type(&self) -> i32

source

pub fn set_version(&mut self, n: i32)

source

pub fn get_version(&self) -> i32

source

pub fn read(&mut self, pch: *mut u8, n_size: usize)

source

pub fn ignore(&mut self, n_size: i32)

source

pub fn write(&mut self, pch: *const u8, n_size: usize)

source

pub fn serialize<Stream>(&self, s: &mut Stream)

source

pub fn xor(&mut self, key: &Vec<u8>)

| XOR the contents of this stream with | a certain key. | | ———– | @param[in] key | | The key used to XOR the data in this stream. |

Trait Implementations§

source§

impl Index<usize> for DataStream

§

type Output = Vec<u8, ZeroAfterFreeAllocator>

The returned type after indexing.
source§

fn index(&self, pos: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<usize> for DataStream

source§

fn index_mut(&mut self, pos: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl StreamInto for DataStream

source§

fn stream_into<Item>(&self, rhs: &mut Item)

source§

impl StreamItems for DataStream

source§

fn stream<Item>(&mut self, x: Item)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,

§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> StaticUpcast<T> for T

§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V