Skip to main content

BatchStreamReader

Struct BatchStreamReader 

Source
pub struct BatchStreamReader<'a> { /* private fields */ }
Expand description

Reads changes from the streams of a batch.

Implementations§

Source§

impl<'a> BatchStreamReader<'a>

Source

pub fn new(input: &'a mut BatchStreamData) -> Self

Source

pub fn read<T: BatchValue>(&mut self) -> T

Reads a plain value from the value stream. Panics at the end of the stream.

Source

pub fn read_bytes(&mut self, destination: &mut [u8])

Fills destination with the next bytes of the value stream (C# Read(Span<byte>)). Panics at the end of the stream.

Source

pub fn read_object(&mut self) -> BatchObject

Reads the next object slot. Panics at the end of the stream.

Source

pub fn read_server_object(&mut self) -> Option<ServerObjectId>

Reads a reference to a server object (or null).

Source

pub fn read_value<T: Any>(&mut self) -> Option<T>

Reads a payload value of type T (or null).

Source

pub fn read_resource<T: ?Sized + BatchResourceValue>( &mut self, ) -> Option<BatchResource<T>>

Reads a resource reference (or null): a payload value in its wire form or the id of a server object.

Source

pub fn is_object_eof(&self) -> bool

Whether the object stream is exhausted.

Source

pub fn is_struct_eof(&self) -> bool

Whether the value stream is exhausted.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for BatchStreamReader<'a>

§

impl<'a> !Sync for BatchStreamReader<'a>

§

impl<'a> !UnwindSafe for BatchStreamReader<'a>

§

impl<'a> Freeze for BatchStreamReader<'a>

§

impl<'a> Send for BatchStreamReader<'a>

§

impl<'a> Unpin for BatchStreamReader<'a>

§

impl<'a> UnsafeUnpin for BatchStreamReader<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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.

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.