Struct extism_runtime::Internal
source · pub struct Internal {
pub store: *mut Store<Internal>,
pub linker: *mut Linker<Internal>,
pub wasi: Option<Wasi>,
pub http_status: u16,
pub vars: BTreeMap<String, Vec<u8>>,
pub manifest: Manifest,
pub available_pages: Option<u32>,
/* private fields */
}Expand description
Internal stores data that is available to the caller in PDK functions
Fields§
§store: *mut Store<Internal>Store
linker: *mut Linker<Internal>Linker
wasi: Option<Wasi>WASI context
http_status: u16Keep track of the status from the last HTTP request
vars: BTreeMap<String, Vec<u8>>Plugin variables
manifest: Manifest§available_pages: Option<u32>Implementations§
Trait Implementations§
source§impl InternalExt for Internal
impl InternalExt for Internal
fn store(&self) -> &Store<Internal>
fn store_mut(&mut self) -> &mut Store<Internal>
fn linker(&self) -> &Linker<Internal>
fn linker_mut(&mut self) -> &mut Linker<Internal>
fn linker_and_store(&mut self) -> (&mut Linker<Internal>, &mut Store<Internal>)
fn internal(&self) -> &Internal
fn internal_mut(&mut self) -> &mut Internal
fn memory_ptr(&mut self) -> *mut u8
fn memory(&mut self) -> &mut [u8] ⓘ
fn memory_read(&mut self, offs: u64, len: Size) -> &[u8] ⓘ
fn memory_read_str(&mut self, offs: u64) -> Result<&str, Utf8Error>
fn memory_write(&mut self, offs: u64, bytes: impl AsRef<[u8]>)
fn memory_alloc(&mut self, n: Size) -> Result<u64, Error>
fn memory_alloc_bytes(&mut self, bytes: impl AsRef<[u8]>) -> Result<u64, Error>
fn memory_free(&mut self, offs: u64)
fn memory_length(&mut self, offs: u64) -> u64
fn error<E>(&mut self, e: impl Debug, x: E) -> E
fn clear_error(&mut self)
fn has_error(&mut self) -> bool
fn get_error(&mut self) -> Option<&str>
Auto Trait Implementations§
impl !RefUnwindSafe for Internal
impl !Send for Internal
impl !Sync for Internal
impl Unpin for Internal
impl !UnwindSafe for Internal
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
§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where T: AsFilelike,
Query the “status” flags for the
self file descriptor.