pub struct FieldRef<'a> { /* private fields */ }Expand description
Immutable typed view over a field-sized byte slice.
Produced by split_fields (generated by zero_copy_layout!).
Provides typed access without holding a reference to the whole struct.
Implementations§
Source§impl<'a> FieldRef<'a>
impl<'a> FieldRef<'a>
Sourcepub fn read_address(&self) -> Address
pub fn read_address(&self) -> Address
Read as an Address (32-byte public key).
Copies the bytes into an owned Address.
Sourcepub fn as_address(&self) -> &Address
pub fn as_address(&self) -> &Address
Borrow the field bytes as an &Address reference.
§Panics
Panics if the field is smaller than 32 bytes.
Auto Trait Implementations§
impl<'a> Freeze for FieldRef<'a>
impl<'a> RefUnwindSafe for FieldRef<'a>
impl<'a> Send for FieldRef<'a>
impl<'a> Sync for FieldRef<'a>
impl<'a> Unpin for FieldRef<'a>
impl<'a> UnsafeUnpin for FieldRef<'a>
impl<'a> UnwindSafe for FieldRef<'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