pub struct Value { /* private fields */ }
Expand description
§XML-RPC value type
The Value
type is the Rust equivalent of valid XML-RPC values. It provides constructors
from all compatible primitive types, (de)serialization support from and to XML-RPC value
strings, and fallible conversion from and to Value
with implementations of the
TryFromValue
and TryToValue
traits.
Note that the constructors for all primitive value types are infallible, except for the string type, which can fail if the string argument fails to be escaped properly for XML.
In general, using methods from the fallible TryFromValue
and TryToValue
conversion traits is
recommended, as they provide a consistent interface across all types, including Vec
,
arrays, slices, tuples, HashMap
s, and even custom structs, when using the TryFromValue
and
TryToValue
derive macros.
Implementations§
Source§impl Value
impl Value
Sourcepub fn i4(value: i32) -> Value
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
pub fn i4(value: i32) -> Value
constructor for <i4>
values (signed 32-bit integers)
Sourcepub fn i8(value: i64) -> Value
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.Available on crate feature i8
only.
pub fn i8(value: i64) -> Value
i8
only.constructor for <i8>
values (signed 64-bit integers)
This type is not part of the original XML-RPC spec, but is a widely used extension.
Support for <i8>
values is optional and can be enabled with the i8
crate feature.
Sourcepub fn boolean(value: bool) -> Value
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
pub fn boolean(value: bool) -> Value
constructor for <boolean>
values (true or false)
Sourcepub fn string(value: &str) -> Value
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
pub fn string(value: &str) -> Value
constructor for <string>
values
Sourcepub fn double(value: f64) -> Value
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
pub fn double(value: f64) -> Value
constructor for <double>
values (64-bit floating point numbers)
Sourcepub fn datetime(value: DateTime<Utc>) -> Value
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
pub fn datetime(value: DateTime<Utc>) -> Value
constructor for <dateTime.iso8601>
values (date & time)
Note that the date & time format used by XML-RPC does not include sub-second precision, nor
any timezone information. This crate assumes Utc
is used on the server.
Sourcepub fn base64(value: Vec<u8>) -> Value
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
pub fn base64(value: Vec<u8>) -> Value
constructor for <base64>
values (base64-encoded, arbitrary bytes)
Sourcepub fn nil() -> Value
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.Available on crate feature nil
only.
pub fn nil() -> Value
nil
only.constructor for the <nil/>
value (empty / missing value)
This type is not part of the original XML-RPC spec, but is a widely used extension.
Support for <nil>
values is optional and can be enabled with the nil
crate feature.
If enabled, this type is used to emulate support for optional values in XML-RPC, by mapping
Rust Option
s to either their contained Value
, or to a <nil>
value. This is
consistent with the XML-RPC implementation in the Python xmlrpc
standard library module.