logo
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

new

Trait Implementations

Call the syscall function

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.