pub struct SoapFault {
pub code: FaultCode,
pub reason: String,
pub detail: Option<String>,
pub detail_xml: Option<String>,
}Fields§
§code: FaultCode§reason: String§detail: Option<String>§detail_xml: Option<String>Raw, verbatim XML to emit as the fault detail child element (not escaped).
Takes precedence over detail when both are set.
Implementations§
Source§impl SoapFault
impl SoapFault
pub fn new( code: FaultCode, reason: impl Into<String>, detail: Option<String>, ) -> Self
Sourcepub fn with_detail_xml(self, xml: impl Into<String>) -> Self
pub fn with_detail_xml(self, xml: impl Into<String>) -> Self
Attach a raw XML child element as the fault detail. The provided XML is emitted
VERBATIM inside <env:Detail> (SOAP 1.2) / <detail> (SOAP 1.1) — it is NOT escaped,
so the caller MUST supply well-formed XML. Takes precedence over the text detail.
pub fn sender(reason: impl Into<String>) -> Self
pub fn receiver(reason: impl Into<String>) -> Self
pub fn version_mismatch() -> Self
pub fn must_understand(header: &str) -> Self
pub fn action_not_supported(action: &str) -> Self
Sourcepub fn to_xml_bytes_versioned(&self, version: &SoapVersion) -> Vec<u8> ⓘ
pub fn to_xml_bytes_versioned(&self, version: &SoapVersion) -> Vec<u8> ⓘ
Serialize to a complete SOAP envelope. Version determines fault structure and code names. SOAP 1.2 uses nested Code/Reason (existing to_xml_bytes). SOAP 1.1 uses flat faultcode/faultstring per W3C SOAP 1.1 spec Section 4.4.
Sourcepub fn to_xml_bytes(&self) -> Vec<u8> ⓘ
pub fn to_xml_bytes(&self) -> Vec<u8> ⓘ
Serialize to a complete SOAP 1.2 envelope XML string. HTTP status is always 500 per W3C SOAP 1.2 spec Section 7.4.2 (FLT-03).
Trait Implementations§
Source§impl Error for SoapFault
impl Error for SoapFault
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for SoapFault
impl RefUnwindSafe for SoapFault
impl Send for SoapFault
impl Sync for SoapFault
impl Unpin for SoapFault
impl UnsafeUnpin for SoapFault
impl UnwindSafe for SoapFault
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