pub struct InstructionDataReader<'a> { /* private fields */ }Expand description
Borsh-compatible instruction data decoder.
Reads fields from instruction data in order.
Implementations§
Source§impl<'a> InstructionDataReader<'a>
impl<'a> InstructionDataReader<'a>
Sourcepub fn read_u8(&mut self) -> Result<u8, SignerError>
pub fn read_u8(&mut self) -> Result<u8, SignerError>
Read a u8.
Sourcepub fn read_u16(&mut self) -> Result<u16, SignerError>
pub fn read_u16(&mut self) -> Result<u16, SignerError>
Read a u16 (little-endian).
Sourcepub fn read_u32(&mut self) -> Result<u32, SignerError>
pub fn read_u32(&mut self) -> Result<u32, SignerError>
Read a u32 (little-endian).
Sourcepub fn read_u64(&mut self) -> Result<u64, SignerError>
pub fn read_u64(&mut self) -> Result<u64, SignerError>
Read a u64 (little-endian).
Sourcepub fn read_bool(&mut self) -> Result<bool, SignerError>
pub fn read_bool(&mut self) -> Result<bool, SignerError>
Read a bool.
Sourcepub fn read_bytes(&mut self, n: usize) -> Result<&'a [u8], SignerError>
pub fn read_bytes(&mut self, n: usize) -> Result<&'a [u8], SignerError>
Read exactly n bytes.
Sourcepub fn read_pubkey(&mut self) -> Result<[u8; 32], SignerError>
pub fn read_pubkey(&mut self) -> Result<[u8; 32], SignerError>
Read a 32-byte public key.
Sourcepub fn read_string(&mut self) -> Result<String, SignerError>
pub fn read_string(&mut self) -> Result<String, SignerError>
Read a Borsh-encoded string (u32 len + UTF-8).
Auto Trait Implementations§
impl<'a> Freeze for InstructionDataReader<'a>
impl<'a> RefUnwindSafe for InstructionDataReader<'a>
impl<'a> Send for InstructionDataReader<'a>
impl<'a> Sync for InstructionDataReader<'a>
impl<'a> Unpin for InstructionDataReader<'a>
impl<'a> UnsafeUnpin for InstructionDataReader<'a>
impl<'a> UnwindSafe for InstructionDataReader<'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