pub struct MlxIoReader { /* private fields */ }Expand description
Owned MLX reader transport released exactly once.
The descriptor and vtable follow MLX-C’s mlx_io_reader contract; the
safe surface keeps the pair together so the transport stays valid for its
whole lifetime.
Implementations§
Source§impl MlxIoReader
impl MlxIoReader
Sourcepub unsafe fn from_parts(
descriptor: *mut c_void,
vtable: mlx_io_vtable,
) -> Result<Self, MlxCError>
pub unsafe fn from_parts( descriptor: *mut c_void, vtable: mlx_io_vtable, ) -> Result<Self, MlxCError>
Builds an owned reader from a descriptor and vtable following the MLX-C io contract.
§Safety
The descriptor must satisfy the vtable’s expectations for the reader’s whole lifetime, and every vtable slot must be a valid C ABI function.
Sourcepub fn descriptor(&self) -> Result<*mut c_void, MlxCError>
pub fn descriptor(&self) -> Result<*mut c_void, MlxCError>
The descriptor this transport was built with.
Sourcepub fn to_string_lossy(&self) -> Result<String, MlxCError>
pub fn to_string_lossy(&self) -> Result<String, MlxCError>
Renders the reader description text.
Trait Implementations§
Source§impl Debug for MlxIoReader
impl Debug for MlxIoReader
Source§impl Drop for MlxIoReader
impl Drop for MlxIoReader
Auto Trait Implementations§
impl !Send for MlxIoReader
impl !Sync for MlxIoReader
impl Freeze for MlxIoReader
impl RefUnwindSafe for MlxIoReader
impl Unpin for MlxIoReader
impl UnsafeUnpin for MlxIoReader
impl UnwindSafe for MlxIoReader
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