[−][src]Enum simple_xmlrpc::Value
Variants
Int(i32)
A 32-bit signed integer (<i4>
or <int>
).
Int64(i64)
A 64-bit signed integer (<i8>
).
Bool(bool)
A boolean value (<boolean>
, 0 == false
, 1 == true
).
String(String)
A string (<string>
).
Double(f64)
A double-precision IEEE 754 floating point number (<double>
).
DateTime(DateTime)
An ISO 8601 formatted date/time value (<dateTime.iso8601>
).
Base64-encoded binary data (<base64>
).
A mapping of named values (<struct>
).
A list of arbitrary (heterogeneous) values (<array>
).
The empty (Unit) value (<nil/>
).
Methods
impl Value
[src]
pub fn stringify(&self) -> Result<String>
[src]
pub fn as_i32(&self) -> Option<i32>
[src]
Returns an inner struct or array value indexed by index
.
Returns None
if the member doesn't exist or self
is neither a struct nor an array.
You can also use Rust's square-bracket indexing syntax to perform this operation if you want
a default value instead of an Option
. Refer to the top-level examples for
details.
If the Value
is a normal integer (Value::Int
), returns associated value. Returns None
otherwise.
In particular, None
is also returned if self
is a Value::Int64
. Use as_i64
to
handle this case.
pub fn as_i64(&self) -> Option<i64>
[src]
If the Value
is an integer, returns associated value. Returns None
otherwise.
This works with both Value::Int
and Value::Int64
.
pub fn as_bool(&self) -> Option<bool>
[src]
If the Value
is a boolean, returns associated value. Returns None
otherwise.
pub fn as_str(&self) -> Option<&str>
[src]
If the Value
is a string, returns associated value. Returns None
otherwise.
pub fn as_f64(&self) -> Option<f64>
[src]
If the Value
is a floating point number, returns associated value. Returns None
otherwise.
pub fn as_datetime(&self) -> Option<DateTime>
[src]
If the Value
is a date/time, returns associated value. Returns None
otherwise.
pub fn as_bytes(&self) -> Option<&[u8]>
[src]
If the Value
is base64 binary data, returns associated value. Returns None
otherwise.
pub fn as_struct(&self) -> Option<&BTreeMap<String, Value>>
[src]
If the Value
is a struct, returns associated map. Returns None
otherwise.
pub fn as_array(&self) -> Option<&[Value]>
[src]
If the Value
is an array, returns associated slice. Returns None
otherwise.
Trait Implementations
impl Clone for Value
[src]
impl Debug for Value
[src]
impl<'_> From<&'_ str> for Value
[src]
impl From<BTreeMap<String, Value>> for Value
[src]
impl From<DateTime> for Value
[src]
impl From<String> for Value
[src]
impl From<Vec<Value>> for Value
[src]
impl From<Vec<u8>> for Value
[src]
impl From<bool> for Value
[src]
impl From<f64> for Value
[src]
impl From<i32> for Value
[src]
impl From<i64> for Value
[src]
impl PartialEq<Value> for Value
[src]
impl StructuralPartialEq for Value
[src]
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,