pub struct RemoteQueryFailure { /* private fields */ }Expand description
One structured remote failure bound to its request.
Implementations§
Source§impl RemoteQueryFailure
impl RemoteQueryFailure
Sourcepub fn new(nonce: Option<String>, diagnostic: &Diagnostic) -> Self
pub fn new(nonce: Option<String>, diagnostic: &Diagnostic) -> Self
Bind one structured diagnostic to the request nonce.
Sourcepub fn bound(
nonce: impl Into<String>,
request: &RemoteRequestFingerprint,
diagnostic: &Diagnostic,
) -> Self
pub fn bound( nonce: impl Into<String>, request: &RemoteRequestFingerprint, diagnostic: &Diagnostic, ) -> Self
Bind one structured diagnostic to the nonce and the exact request.
Sourcepub fn verify_binding(
&self,
expected_nonce: &str,
expected_request: &RemoteRequestFingerprint,
) -> Result<(), Diagnostic>
pub fn verify_binding( &self, expected_nonce: &str, expected_request: &RemoteRequestFingerprint, ) -> Result<(), Diagnostic>
Verify this failure’s binding to the request the caller sent.
Both the nonce and whole-request digest are mandatory on a reply to a valid request. Pre-decode transport failures use a separate channel; an unbound envelope is never treated as request-correlated evidence.
Sourcepub fn encode_signed(
&self,
advertisement: &RemoteCapabilitiesFingerprint,
signer: &impl RemoteReplySigner,
) -> Result<Vec<u8>, Diagnostic>
pub fn encode_signed( &self, advertisement: &RemoteCapabilitiesFingerprint, signer: &impl RemoteReplySigner, ) -> Result<Vec<u8>, Diagnostic>
Encode one authenticated outer reply using the exact trusted advertisement.
Sourcepub fn encode_signed_or_fallback(
&self,
advertisement: &RemoteCapabilitiesFingerprint,
signer: &impl RemoteReplySigner,
) -> Vec<u8> ⓘ
pub fn encode_signed_or_fallback( &self, advertisement: &RemoteCapabilitiesFingerprint, signer: &impl RemoteReplySigner, ) -> Vec<u8> ⓘ
Encode an authenticated failure, replacing an unencodable diagnostic with a fixed bounded internal failure while preserving safe bindings.
Server transports use this path so production failures can never collapse to empty or unsigned bytes merely because an upstream error message exceeded a codec ceiling.
Sourcepub fn decode_payload(bytes: &[u8]) -> Result<Self, Diagnostic>
pub fn decode_payload(bytes: &[u8]) -> Result<Self, Diagnostic>
Decode an already authenticated failure payload.
Sourcepub fn diagnostic(&self) -> Result<Diagnostic, Diagnostic>
pub fn diagnostic(&self) -> Result<Diagnostic, Diagnostic>
Rebuild the structured diagnostic.
Trait Implementations§
Source§impl Clone for RemoteQueryFailure
impl Clone for RemoteQueryFailure
Source§fn clone(&self) -> RemoteQueryFailure
fn clone(&self) -> RemoteQueryFailure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more