pub enum TemplateError {
PlaceholderMissing(String),
PlaceholderUnknown(String),
InjectionDetected {
slot: String,
reason: String,
},
SecretLeakBlocked {
pattern: String,
},
OversizeContext {
bytes: usize,
max: usize,
},
}Expand description
Failures from PromptTemplate::render. Every variant carries
enough detail for the audit log without echoing the offending
payload — reason strings are bounded to a short categorical
label, never the raw input.
Variants§
PlaceholderMissing(String)
A {placeholder} in the template body has no slot to fill it.
PlaceholderUnknown(String)
A {placeholder} slot was supplied that the template body
does not reference. Surfaces drift between operator template
and runtime caller.
InjectionDetected
Injection signal detected in a slot. slot names the slot
category; reason is a short label
(role_flip/placeholder_breakout/json_breakout/…).
The offending payload is not included.
SecretLeakBlocked
A secret-shaped pattern was found in a slot category that is not allowed to carry one. The pattern name is included; the matched bytes are not.
OversizeContext
Rendered total exceeded the per-tier byte cap.
Trait Implementations§
Source§impl Clone for TemplateError
impl Clone for TemplateError
Source§fn clone(&self) -> TemplateError
fn clone(&self) -> TemplateError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TemplateError
impl Debug for TemplateError
Source§impl Display for TemplateError
impl Display for TemplateError
Source§impl Error for TemplateError
impl Error for TemplateError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for TemplateError
impl PartialEq for TemplateError
Source§fn eq(&self, other: &TemplateError) -> bool
fn eq(&self, other: &TemplateError) -> bool
self and other values to be equal, and is used by ==.impl Eq for TemplateError
impl StructuralPartialEq for TemplateError
Auto Trait Implementations§
impl Freeze for TemplateError
impl RefUnwindSafe for TemplateError
impl Send for TemplateError
impl Sync for TemplateError
impl Unpin for TemplateError
impl UnsafeUnpin for TemplateError
impl UnwindSafe for TemplateError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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>
T in a tonic::Request