Struct solana_rbpf::syscalls::BpfGatherBytes
source · [−]pub struct BpfGatherBytes {}
Expand description
The idea is to assemble five bytes into a single u64
. For compatibility with the syscalls API,
each argument must be a u64
.
Examples
use solana_rbpf::syscalls::{BpfGatherBytes, Result};
use solana_rbpf::memory_region::{MemoryRegion, MemoryMapping};
use solana_rbpf::vm::{Config, SyscallObject};
use solana_rbpf::user_error::UserError;
let mut result: Result = Ok(0);
let config = Config::default();
let mut memory_mapping = MemoryMapping::new::<UserError>(vec![], &config).unwrap();
BpfGatherBytes::call(&mut BpfGatherBytes {}, 0x11, 0x22, 0x33, 0x44, 0x55, &mut memory_mapping, &mut result);
assert_eq!(result.unwrap(), 0x1122334455);
Implementations
sourceimpl BpfGatherBytes
impl BpfGatherBytes
sourcepub fn init<C, E>(_unused: C) -> Box<dyn SyscallObject<UserError>>
pub fn init<C, E>(_unused: C) -> Box<dyn SyscallObject<UserError>>
new
Trait Implementations
sourceimpl SyscallObject<UserError> for BpfGatherBytes
impl SyscallObject<UserError> for BpfGatherBytes
Auto Trait Implementations
impl RefUnwindSafe for BpfGatherBytes
impl Send for BpfGatherBytes
impl Sync for BpfGatherBytes
impl Unpin for BpfGatherBytes
impl UnwindSafe for BpfGatherBytes
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more