pub struct ScriptedPeer { /* private fields */ }Expand description
A hostile A2A peer on a loopback port. See the module docs.
Implementations§
Source§impl ScriptedPeer
impl ScriptedPeer
Sourcepub const fn new() -> Self
pub const fn new() -> Self
A JSON-RPC peer that stalls after one event; the methods below change either half.
Sourcepub const fn stall_after(self, events: usize) -> Self
pub const fn stall_after(self, events: usize) -> Self
Send events, then fall silent with the connection held open.
Sourcepub const fn cut_off_after(self, events: usize) -> Self
pub const fn cut_off_after(self, events: usize) -> Self
Send events, then drop the connection (or, on gRPC, reset the stream).
Sourcepub const fn misframe_after(self, events: usize) -> Self
pub const fn misframe_after(self, events: usize) -> Self
Send events, then one that does not parse, then fall silent.
Refuse every call as unauthenticated.
Sourcepub async fn start(self) -> Result<RunningPeer>
pub async fn start(self) -> Result<RunningPeer>
Trait Implementations§
Source§impl Clone for ScriptedPeer
impl Clone for ScriptedPeer
impl Copy for ScriptedPeer
Source§impl Debug for ScriptedPeer
impl Debug for ScriptedPeer
Auto Trait Implementations§
impl Freeze for ScriptedPeer
impl RefUnwindSafe for ScriptedPeer
impl Send for ScriptedPeer
impl Sync for ScriptedPeer
impl Unpin for ScriptedPeer
impl UnsafeUnpin for ScriptedPeer
impl UnwindSafe for ScriptedPeer
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request