Expand description
§dxr
This crate provides an implementation of XML-RPC types, (de)serialization support, and
conversion between XML-RPC values and Rust values (with optional support for non-standard i8
and nil
types, which can be enabled with the respective feature flags).
Support for writing XML-RPC clients / servers is provided in separate crates:
dxr_client
: generic XML-RPC client code and a default implementation based onreqwest
dxr_server
: generic XML-RPC server code and a default implementation based onaxum
The table below lists XML-RPC types and their equivalent Rust types.
XML-RPC value type | Rust type |
---|---|
i4 | i32 |
i8 | i64 |
boolean | bool |
string | String / &str |
double | f64 |
dateTime.iso8601 | chrono::NaiveDateTime |
base64 | Vec<u8> |
nil | Option<T> |
Additionally, the TryFromValue
and TryToValue
traits (which implement the conversion
between XML-RPC value types and Rust types) are implemented for
Vec<T>
, slices&[T]
, and fixed-size arrays[T; N]
,- smart pointer types like
Box<T>
,Cow<T>
,Rc<T>
, andArc<T>
, - mappings like
HashMap<String, T>
/HashMap<&str, T>
, - tuples
(T, ...)
with up to eight members
(as long as the inner type T
also implement these traits).
§Features
This crate provides optional features, all of which are disabled by default:
derive
: include procedural macros for deriving theTryFromValue
andTryToValue
traits for custom structsi8
: enable support for the non-standardi8
value typenil
: enable support for the non-standardnil
value type
Re-exports§
pub use chrono;
Structs§
- Fault
- XML-RPC server fault (consisting of a numeric error code and a message)
- Fault
Response - XML-RPC fault response type
- Method
Call - XML-RPC method call type
- Method
Response - XML-RPC method response type
- Value
- XML-RPC value type
Enums§
- DxrError
- Error type representing conversion errors between XML-RPC values and Rust values.
Constants§
- XML_
RPC_ DATE_ FORMAT - Date & time format used by the XML-RPC
dateTime.iso8601
value type
Traits§
- TryFrom
Params - Trait for converting from XML-RPC method call argument lists to Rust values.
- TryFrom
Value - Trait for converting from XML-RPC values to Rust values.
- TryTo
Params - Trait for converting from Rust values to XML-RPC method call arguments.
- TryTo
Value - Trait for converting from Rust values to XML-RPC values.
Functions§
- deserialize_
xml - Function for deserializing values from XML.
- from_
multicall_ params multicall
- Convenience method for reconstructing method calls from “system.multicall” arguments.
- into_
multicall_ params multicall
- Convenience method for constructing arguments for “system.multicall” calls.
- into_
multicall_ response multicall
- Convenience method for constructing return values for “system.multicall” calls.
- serialize_
xml - Custom function for serializing values as XML.
Derive Macros§
- TryFrom
Value derive
- Procedural macro for deriving an implementation of the
TryFromValue
trait for structs. - TryTo
Value derive
- Procedural macro for deriving an implementation of the
TryToValue
trait for structs.