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: u16
Keep 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 Freeze for Internal
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§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.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self
file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more