Crate dxr

Crate dxr 

Source
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 on reqwest
  • dxr_server: generic XML-RPC server code and a default implementation based on axum

The table below lists XML-RPC types and their equivalent Rust types.

XML-RPC value typeRust type
i4i32
i8i64
booleanbool
stringString / &str
doublef64
dateTime.iso8601DateTime
base64Vec<u8>
nilOption<T>

Additionally, the TryFromValue and TryToValue traits (which implement the conversion between XML-RPC value types and Rust types) are implemented for

(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 the TryFromValue and TryToValue traits for custom structs
  • i8: enable support for the non-standard i8 value type
  • nil: enable support for the non-standard nil value type

Modules§

multicallmulticall
Helper functions for dealing with “system.multicall” method calls.

Structs§

DateTime
Naive date / time type representing XML-RPC values of type dateTime.iso8601
Fault
XML-RPC server fault (consisting of a numeric error code and a message)
FaultResponse
XML-RPC fault response type
MethodCall
XML-RPC method call type
MethodResponse
XML-RPC method call type

Enums§

Error
Error type representing conversion errors between XML-RPC values and Rust values.
Value
XML-RPC value type

Traits§

TryFromParams
Trait for converting from XML-RPC method call argument lists to Rust values.
TryFromValue
Trait for converting from XML-RPC values to Rust values.
TryToParams
Trait for converting from Rust values to XML-RPC method call arguments.
TryToValue
Trait for converting from Rust values to XML-RPC values.

Derive Macros§

TryFromValuederive
Procedural macro for deriving an implementation of the TryFromValue trait for structs.
TryToValuederive
Procedural macro for deriving an implementation of the TryToValue trait for structs.