pub struct HostFunctionContext {
pub plugin_name: String,
pub capabilities: WasmPluginCapabilities,
pub audit_log: Vec<AuditEntry>,
pub transaction_id: Option<u64>,
pub session_vars: HashMap<String, Vec<u8>>,
}Expand description
Context passed to host function implementations
Contains the plugin’s capabilities and access to database resources.
Fields§
§plugin_name: StringPlugin name (for logging)
capabilities: WasmPluginCapabilitiesPlugin capabilities
audit_log: Vec<AuditEntry>Audit log for this call chain
transaction_id: Option<u64>Current transaction ID (if any)
session_vars: HashMap<String, Vec<u8>>Session variables
Implementations§
Source§impl HostFunctionContext
impl HostFunctionContext
Sourcepub fn new(plugin_name: &str, capabilities: WasmPluginCapabilities) -> Self
pub fn new(plugin_name: &str, capabilities: WasmPluginCapabilities) -> Self
Create a new context for a plugin
Sourcepub fn check_read(&self, table: &str) -> KernelResult<()>
pub fn check_read(&self, table: &str) -> KernelResult<()>
Check if the plugin can read from a table
Sourcepub fn check_write(&self, table: &str) -> KernelResult<()>
pub fn check_write(&self, table: &str) -> KernelResult<()>
Check if the plugin can write to a table
Sourcepub fn check_vector_search(&self) -> KernelResult<()>
pub fn check_vector_search(&self) -> KernelResult<()>
Check if the plugin can perform vector search
Sourcepub fn check_index_search(&self) -> KernelResult<()>
pub fn check_index_search(&self) -> KernelResult<()>
Check if the plugin can perform index search
Auto Trait Implementations§
impl Freeze for HostFunctionContext
impl RefUnwindSafe for HostFunctionContext
impl Send for HostFunctionContext
impl Sync for HostFunctionContext
impl Unpin for HostFunctionContext
impl UnsafeUnpin for HostFunctionContext
impl UnwindSafe for HostFunctionContext
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> 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