Struct Value

Source
pub struct Value { /* private fields */ }
👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
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, HashMaps, and even custom structs, when using the TryFromValue and TryToValue derive macros.

Implementations§

Source§

impl Value

Source

pub fn i4(value: i32) -> Value

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.

constructor for <i4> values (signed 32-bit integers)

Source

pub 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.

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.

Source

pub fn boolean(value: bool) -> Value

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.

constructor for <boolean> values (true or false)

Source

pub fn string(value: &str) -> Value

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.

constructor for <string> values

Source

pub fn double(value: f64) -> Value

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.

constructor for <double> values (64-bit floating point numbers)

Source

pub fn datetime(value: DateTime<Utc>) -> Value

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.

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.

Source

pub fn base64(value: Vec<u8>) -> Value

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.

constructor for <base64> values (base64-encoded, arbitrary bytes)

Source

pub 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.

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 Options 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.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Value

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Value

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFromParams for Value

Source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
conversion method from XML-RPC method call argument lists to Rust types Read more
Source§

impl TryFromValue for Value

Source§

fn try_from_value(value: &Value) -> Result<Value, DxrError>

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
fallible conversion method from an XML-RPC value into the target type Read more
Source§

impl TryToParams for &Value

Source§

fn try_to_params(&self) -> Result<Vec<Value>, DxrError>

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
conversion method from types into XML-RPC method call argument lists Read more
Source§

impl TryToParams for Value

Source§

fn try_to_params(&self) -> Result<Vec<Value>, DxrError>

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
conversion method from types into XML-RPC method call argument lists Read more
Source§

impl TryToValue for Value

Source§

fn try_to_value(&self) -> Result<Value, DxrError>

👎Deprecated since 0.5.5: The dxr_shared crate was renamed to dxr with version 0.6.0.
fallible conversion method from types into XML-RPC values Read more
Source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,