pub struct DataReader { /* private fields */ }Expand description
An owned, bounded binary reader for advanced native loading.
Implementations§
Source§impl DataReader
impl DataReader
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Copies the buffer into a native reader that outlives it and supports both formatted scanning and raw reads, so parameter text and weight streams load through the same handle.
Sourcepub fn from_reader(reader: impl Read) -> Result<Self>
pub fn from_reader(reader: impl Read) -> Result<Self>
Reads the whole stream into an owned buffer.
Trait Implementations§
Source§impl Drop for DataReader
impl Drop for DataReader
Source§impl<'a> From<&'a DataReader> for ParamSource<'a>
impl<'a> From<&'a DataReader> for ParamSource<'a>
Source§fn from(reader: &'a DataReader) -> Self
fn from(reader: &'a DataReader) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a DataReader> for WeightSource<'a>
impl<'a> From<&'a DataReader> for WeightSource<'a>
Source§fn from(reader: &'a DataReader) -> Self
fn from(reader: &'a DataReader) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Send for DataReader
impl !Sync for DataReader
impl Freeze for DataReader
impl RefUnwindSafe for DataReader
impl Unpin for DataReader
impl UnsafeUnpin for DataReader
impl UnwindSafe for DataReader
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