#[repr(C)]pub struct HookResult {
pub verdict: u32,
pub modified_data_offset: u32,
pub modified_data_len: u32,
pub inject_actions_offset: u32,
pub inject_actions_count: u32,
pub log_offset: u32,
pub log_len: u32,
}Expand description
Result returned from a WASM hook invocation.
Laid out as #[repr(C)] for direct reading from WASM linear memory.
Fields§
§verdict: u32Verdict as u32 discriminant (see Verdict).
modified_data_offset: u32§modified_data_len: u32Length of modified data. 0 if no modification.
inject_actions_offset: u32§inject_actions_count: u32Number of injected actions. 0 if no injections.
log_offset: u32§log_len: u32Length of log message. 0 if no log message.
Implementations§
Source§impl HookResult
impl HookResult
Sourcepub fn continue_result() -> HookResult
pub fn continue_result() -> HookResult
Create a Continue result with no modifications.
Sourcepub fn drop_result() -> HookResult
pub fn drop_result() -> HookResult
Create a Drop result.
Sourcepub fn modify_result(data_offset: u32, data_len: u32) -> HookResult
pub fn modify_result(data_offset: u32, data_len: u32) -> HookResult
Create a Modify result pointing at modified data.
Trait Implementations§
Source§impl Clone for HookResult
impl Clone for HookResult
Source§fn clone(&self) -> HookResult
fn clone(&self) -> HookResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HookResult
impl Debug for HookResult
impl Copy for HookResult
Auto Trait Implementations§
impl Freeze for HookResult
impl RefUnwindSafe for HookResult
impl Send for HookResult
impl Sync for HookResult
impl Unpin for HookResult
impl UnsafeUnpin for HookResult
impl UnwindSafe for HookResult
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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