pub struct HookOutcome {
pub body: String,
pub deferred_ack: Option<(SessionId, Vec<MessageId>)>,
}Expand description
A hook’s HTTP response body, plus any inbox ack that must be deferred until the response is confirmed written back to the caller.
Acking is what marks a surfaced message “delivered”. Doing it inside the
hook — before the <marshal_inbox> bytes reach the agent — is at-most-once:
a response that times out (curl --max-time 5) or drops mid-write would
leave the messages marked read but never seen. So surface_unread returns
the surfaced ids here and the listener acks them ONLY after a successful
write_all+flush (see ack_surfaced), making inbox delivery at-least-once:
a failed write leaves them unread to re-surface next turn.
Fields§
§body: String§deferred_ack: Option<(SessionId, Vec<MessageId>)>Auto Trait Implementations§
impl Freeze for HookOutcome
impl RefUnwindSafe for HookOutcome
impl Send for HookOutcome
impl Sync for HookOutcome
impl Unpin for HookOutcome
impl UnsafeUnpin for HookOutcome
impl UnwindSafe for HookOutcome
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