#[non_exhaustive]pub struct ConfigWarning {
pub tool: String,
pub param: String,
pub rule: &'static str,
pub detail: String,
}Expand description
One non-fatal finding from crate::config::ServerConfig::lint
(Phase 128, D-07).
§Why this exists instead of a validate() variant
ConfigValidationError is first-error-wins Result<(), _> with no warning
channel, so D-07’s “warns” is unexpressible in that signature. A running server
must NOT refuse to boot because a free-text body parameter has no max_length
(D-05) — but the author still has to be told, and the startup log is what makes
a later regression traceable. Hence a separate additive -> Vec<ConfigWarning>
channel that leaves validate’s existing behaviour untouched.
[server.validation] strict = true is what promotes a finding into a
ConfigValidationError::UncappedStringParam.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tool: StringThe [[tools]] name the finding concerns.
EMPTY for a server-level finding — an active [server.validation] opt-out
belongs to the server, not to a tool.
param: StringThe [[tools.parameters]] name the finding concerns.
EMPTY for a server-level finding, for the same reason as Self::tool —
and ALSO empty for a TOOL-level finding, one that concerns the [[tools]]
entry as a whole rather than any one parameter (lint_against_spec’s
configured-template-not-in-spec is the live case). So the two fields encode
three scopes, and this field alone does not distinguish server-level from
tool-level: read it together with Self::tool, exactly as this type’s
Display does. A consumer switching on scope should test BOTH.
rule: &'static strStable machine-readable rule identifier, e.g. "uncapped-string".
A &'static str rather than an enum so plan 07’s CLI and plan 09’s startup
log can group and filter on it without either taking a dependency on a
closed set that every new rule would widen.
detail: StringHuman-readable explanation, including the remedy.
Author-facing, like ConfigValidationError’s messages and unlike a
client-facing refusal: it may name config keys and declared limits. It never
contains caller data — lint runs at load time with no request in scope.
Trait Implementations§
Source§impl Clone for ConfigWarning
impl Clone for ConfigWarning
Source§impl Debug for ConfigWarning
impl Debug for ConfigWarning
Source§impl Display for ConfigWarning
impl Display for ConfigWarning
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Renders the THREE scopes the two sentinel fields encode, not two.
tool and param are independently empty-as-sentinel, so they describe a
server-level, a tool-level, or a parameter-level finding. Branching on
tool alone collapsed the middle case into the parameter arm and rendered
a tool-level finding as ... 'get_cui' parameter '': ... — reachable
today from ServerConfig::lint_against_spec, which emits
configured-template-not-in-spec with a tool name and an empty param,
and printed verbatim to the deploy log by pmcp-openapi-server.
impl Eq for ConfigWarning
Source§impl PartialEq for ConfigWarning
impl PartialEq for ConfigWarning
impl StructuralPartialEq for ConfigWarning
Auto Trait Implementations§
impl Freeze for ConfigWarning
impl RefUnwindSafe for ConfigWarning
impl Send for ConfigWarning
impl Sync for ConfigWarning
impl Unpin for ConfigWarning
impl UnsafeUnpin for ConfigWarning
impl UnwindSafe for ConfigWarning
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more