pub struct Facts { /* private fields */ }Expand description
Machine-readable facts attached to an Error.
Fact keys are static strings so they can be treated as a documented contract
by tests, reports, and callers. Values are stringified with ToString.
Iteration is sorted by key because facts are stored in a BTreeMap.
Raw lookup and iteration preserve every value. fmt::Debug
exposes only facts explicitly approved through Error::with_log_safe_fact,
using the same sanitized and bounded projection as server observability.
Empty keys are ignored and duplicate inserts preserve the first value and
disclosure choice. Rejected keys are reported deterministically under
fact_collision_keys. The adapter reserves cudf_* for cuDF
classification and native_* for wrapped query-engine errors;
colliding native facts are reported under native_fact_collision_keys.
Implementations§
Source§impl Facts
impl Facts
Sourcepub fn iter(&self) -> impl Iterator<Item = (&'static str, &str)>
pub fn iter(&self) -> impl Iterator<Item = (&'static str, &str)>
Iterates facts in sorted key order.
Sourcepub fn insert_log_safe(&mut self, key: &'static str, value: String)
pub fn insert_log_safe(&mut self, key: &'static str, value: String)
Inserts a fact approved by the caller for log disclosure.
Empty or duplicate keys follow Facts collision rules. The reserved
truncation marker is retained as raw data and cannot mark itself log-safe.
Sourcepub fn log_safe_projection(&self) -> LogSafeFactProjection
pub fn log_safe_projection(&self) -> LogSafeFactProjection
Returns only disclosure-approved facts after sanitizing and applying count and byte bounds.
The projection records truncation without modifying the stored raw facts.
Sourcepub fn retained_capture_entries(
&self,
client_detail: Option<&ClientDetail>,
) -> Vec<(String, String)>
pub fn retained_capture_entries( &self, client_detail: Option<&ClientDetail>, ) -> Vec<(String, String)>
Retained entries for query-caller-visible capture (query stats).
Combines the log-safe operational projection with the error’s
ClientDetail. Detail values are raw caller schema identifiers: they
are sanitized and bounded the same way as log-safe values. Their presence
here discloses them to the query caller and does not claim log safety.
A single error_facts_truncated marker covers truncation in either
projection. Operational logs and fmt::Debug keep using
Self::log_safe_projection without the detail.
Trait Implementations§
impl Eq for Facts
impl StructuralPartialEq for Facts
Auto Trait Implementations§
impl Freeze for Facts
impl RefUnwindSafe for Facts
impl Send for Facts
impl Sync for Facts
impl Unpin for Facts
impl UnsafeUnpin for Facts
impl UnwindSafe for Facts
Blanket Implementations§
impl<T> Allocation for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 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