pub struct BatchStreamReader<'a> { /* private fields */ }Expand description
Reads changes from the streams of a batch.
Implementations§
Source§impl<'a> BatchStreamReader<'a>
impl<'a> BatchStreamReader<'a>
pub fn new(input: &'a mut BatchStreamData) -> Self
Sourcepub fn read<T: BatchValue>(&mut self) -> T
pub fn read<T: BatchValue>(&mut self) -> T
Reads a plain value from the value stream. Panics at the end of the stream.
Sourcepub fn read_bytes(&mut self, destination: &mut [u8])
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.
Sourcepub fn read_object(&mut self) -> BatchObject
pub fn read_object(&mut self) -> BatchObject
Reads the next object slot. Panics at the end of the stream.
Sourcepub fn read_server_object(&mut self) -> Option<ServerObjectId>
pub fn read_server_object(&mut self) -> Option<ServerObjectId>
Reads a reference to a server object (or null).
Sourcepub fn read_value<T: Any>(&mut self) -> Option<T>
pub fn read_value<T: Any>(&mut self) -> Option<T>
Reads a payload value of type T (or null).
Sourcepub fn read_resource<T: ?Sized + BatchResourceValue>(
&mut self,
) -> Option<BatchResource<T>>
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.
Sourcepub fn is_object_eof(&self) -> bool
pub fn is_object_eof(&self) -> bool
Whether the object stream is exhausted.
Sourcepub fn is_struct_eof(&self) -> bool
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> 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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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