pub enum StubBehavior {
Empty,
Echo,
Canned(TokenSet),
SlowDuration(Duration),
RawJson(String),
}Expand description
Behaviors the NerProvider::Stub variant can simulate.
Variants§
Empty
Always returns an empty TokenSet.
Echo
Returns the input echoed as a single keyword (lowercased, trimmed). Useful for round-trip tests.
Canned(TokenSet)
Returns a fixed canned response — useful for snapshot tests where the caller wants to assert downstream stage output.
SlowDuration(Duration)
Sleeps Duration then returns success — used to drive the
timeout path under tests without waiting on real network I/O.
RawJson(String)
Returns a hand-crafted JSON string verbatim, pushed through the same parse + sanitize pipeline as a real LLM response. Lets adversarial-corpus tests stress the response sanitizer without a real provider.
Trait Implementations§
Source§impl Clone for StubBehavior
impl Clone for StubBehavior
Source§fn clone(&self) -> StubBehavior
fn clone(&self) -> StubBehavior
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StubBehavior
impl RefUnwindSafe for StubBehavior
impl Send for StubBehavior
impl Sync for StubBehavior
impl Unpin for StubBehavior
impl UnsafeUnpin for StubBehavior
impl UnwindSafe for StubBehavior
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> 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 moreSource§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