pub struct FieldMut<'a> { /* private fields */ }Expand description
Mutable typed view over a field-sized byte slice.
Produced by split_fields_mut (generated by zero_copy_layout!).
Provides typed mutation without holding &mut to the whole struct.
Implementations§
Source§impl<'a> FieldMut<'a>
impl<'a> FieldMut<'a>
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8]
pub fn as_bytes_mut(&mut self) -> &mut [u8]
Get the raw mutable bytes.
Sourcepub fn read_address(&self) -> Address
pub fn read_address(&self) -> Address
Read as an Address (32-byte public key).
Sourcepub fn as_address(&self) -> &Address
pub fn as_address(&self) -> &Address
Borrow the field bytes as an &Address reference.
Sourcepub fn write_address(&mut self, addr: &Address)
pub fn write_address(&mut self, addr: &Address)
Write an Address (32-byte public key).
Sourcepub fn write_bool(&mut self, v: bool)
pub fn write_bool(&mut self, v: bool)
Write a bool.
Sourcepub fn write_u128(&mut self, v: u128)
pub fn write_u128(&mut self, v: u128)
Write a u128 (LE).
Sourcepub fn write_i128(&mut self, v: i128)
pub fn write_i128(&mut self, v: i128)
Write an i128 (LE).
Auto Trait Implementations§
impl<'a> Freeze for FieldMut<'a>
impl<'a> RefUnwindSafe for FieldMut<'a>
impl<'a> Send for FieldMut<'a>
impl<'a> Sync for FieldMut<'a>
impl<'a> Unpin for FieldMut<'a>
impl<'a> UnsafeUnpin for FieldMut<'a>
impl<'a> !UnwindSafe for FieldMut<'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