pub struct HookResponse {
pub hook_id: String,
pub action: HookAction,
pub reason: Option<String>,
pub modified: Option<Value>,
pub retry_delay_ms: Option<u64>,
}Expand description
Response from a hook handler
Fields§
§hook_id: StringThe hook ID this response is for
action: HookActionAction to take
reason: Option<String>Reason for blocking (if action is Block)
modified: Option<Value>Modified data (if action is Continue with modifications)
retry_delay_ms: Option<u64>Retry delay in milliseconds (if action is Retry)
Implementations§
Source§impl HookResponse
impl HookResponse
Sourcepub fn continue_with(modified: Value) -> Self
pub fn continue_with(modified: Value) -> Self
Create a continue response with modifications
Sourcepub fn with_hook_id(self, id: impl Into<String>) -> Self
pub fn with_hook_id(self, id: impl Into<String>) -> Self
Set the hook ID
Trait Implementations§
Source§impl Clone for HookResponse
impl Clone for HookResponse
Source§fn clone(&self) -> HookResponse
fn clone(&self) -> HookResponse
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 moreAuto Trait Implementations§
impl Freeze for HookResponse
impl RefUnwindSafe for HookResponse
impl Send for HookResponse
impl Sync for HookResponse
impl Unpin for HookResponse
impl UnsafeUnpin for HookResponse
impl UnwindSafe for HookResponse
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