pub struct ExternalMutStorage { /* private fields */ }Expand description
Full re-export of zenpixels core types (zero module name collisions!).
Type-erased mutable external owned backing storage (Box<[T]>, custom-allocator
wrappers, mutable pool leases, FFI writable buffers).
Both read and in-place write access are strictly zero-copy; calling
into_inner recovers the original owner S zero-copy.
Implementations§
Source§impl ExternalMutStorage
impl ExternalMutStorage
Sourcepub fn new<S>(owner: S) -> ExternalMutStorage
pub fn new<S>(owner: S) -> ExternalMutStorage
Wrap any S: ByteStorageMut + Send + Sync + 'static zero-copy.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Active mutable byte view (zero-copy in place).
Sourcepub fn truncate(&mut self, byte_len: usize)
pub fn truncate(&mut self, byte_len: usize)
Narrow active byte length without touching or copying the external owner.
Sourcepub fn downcast_ref<S>(&self) -> Option<&S>where
S: 'static,
pub fn downcast_ref<S>(&self) -> Option<&S>where
S: 'static,
Borrow the original external owner if its concrete type is S.
Sourcepub fn downcast_mut<S>(&mut self) -> Option<&mut S>where
S: 'static,
pub fn downcast_mut<S>(&mut self) -> Option<&mut S>where
S: 'static,
Mutably borrow the original external owner if its concrete type is S.
Sourcepub fn into_inner<S>(self) -> Result<S, ExternalMutStorage>where
S: 'static,
pub fn into_inner<S>(self) -> Result<S, ExternalMutStorage>where
S: 'static,
Recover the original external owner S zero-copy; returns Err(self) untouched if
the stored type is not S.
Trait Implementations§
Source§impl ByteStorage for ExternalMutStorage
impl ByteStorage for ExternalMutStorage
Source§impl ByteStorageMut for ExternalMutStorage
impl ByteStorageMut for ExternalMutStorage
Source§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Mutable underlying bytes in native endianness.
Auto Trait Implementations§
impl !RefUnwindSafe for ExternalMutStorage
impl !UnwindSafe for ExternalMutStorage
impl Freeze for ExternalMutStorage
impl Send for ExternalMutStorage
impl Sync for ExternalMutStorage
impl Unpin for ExternalMutStorage
impl UnsafeUnpin for ExternalMutStorage
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