pub enum JSONGetTextValue<'a> {
    Str(&'a str),
    JSONValue(Value),
    JSONValueRef(&'a Value),
}
Expand description

Represents any valid JSON value. Reference can also be wrapped.

Variants§

§

Str(&'a str)

§

JSONValue(Value)

§

JSONValueRef(&'a Value)

Implementations§

source§

impl<'a> JSONGetTextValue<'a>

source

pub fn from_str<S: AsRef<str> + ?Sized>(s: &'a S) -> JSONGetTextValue<'a>

source

pub fn from_string<S: Into<String>>(s: S) -> JSONGetTextValue<'static>

source

pub fn from_json_str<S: AsRef<str>>( s: S ) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>

source

pub fn from_bool(b: bool) -> JSONGetTextValue<'static>

source

pub fn from_i8(n: i8) -> JSONGetTextValue<'static>

source

pub fn from_i16(n: i16) -> JSONGetTextValue<'static>

source

pub fn from_i32(n: i32) -> JSONGetTextValue<'static>

source

pub fn from_i64(n: i64) -> JSONGetTextValue<'static>

source

pub fn from_i128( n: i128 ) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>

source

pub fn from_isize(n: isize) -> JSONGetTextValue<'static>

source

pub fn from_u8(n: u8) -> JSONGetTextValue<'static>

source

pub fn from_u16(n: u16) -> JSONGetTextValue<'static>

source

pub fn from_u32(n: u32) -> JSONGetTextValue<'static>

source

pub fn from_u64(n: u64) -> JSONGetTextValue<'static>

source

pub fn from_u128( n: u128 ) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>

source

pub fn from_usize(n: usize) -> JSONGetTextValue<'static>

source

pub fn from_f32(n: f32) -> JSONGetTextValue<'static>

source

pub fn from_f64(n: f64) -> JSONGetTextValue<'static>

source

pub fn from_json_value(v: Value) -> JSONGetTextValue<'static>

source

pub fn from_json_value_ref(v: &'a Value) -> JSONGetTextValue<'a>

source

pub fn from_serializable<T: Serialize>( v: T ) -> Result<JSONGetTextValue<'static>, Error>

source

pub fn null() -> JSONGetTextValue<'static>

source§

impl<'a> JSONGetTextValue<'a>

source

pub fn to_json_string(&self) -> String

Convert to a string for JSON format.

source

pub fn to_json(&self) -> String

👎Deprecated since 3.2.0: Please use the to_json_string function instead

Convert to a string for JSON format.

source

pub fn as_str(&self) -> Option<&str>

Convert to a string slice if it is possible (if it is a string).

source

pub fn clone_borrowed(&self) -> JSONGetTextValue<'_>

Clone the reference of this JSONGetTextValue instance.

source§

impl<'a> JSONGetTextValue<'a>

Trait Implementations§

source§

impl<'a> Clone for JSONGetTextValue<'a>

source§

fn clone(&self) -> JSONGetTextValue<'a>

Returns a copy 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<'a> Debug for JSONGetTextValue<'a>

source§

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

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

impl<'de> Deserialize<'de> for JSONGetTextValue<'de>

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<'a> Display for JSONGetTextValue<'a>

source§

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

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

impl<'a> From<&'a Value> for JSONGetTextValue<'a>

source§

fn from(v: &'a Value) -> JSONGetTextValue<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for JSONGetTextValue<'a>

source§

fn from(v: &'a str) -> JSONGetTextValue<'a>

Converts to this type from the input type.
source§

impl From<String> for JSONGetTextValue<'static>

source§

fn from(v: String) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<Value> for JSONGetTextValue<'static>

source§

fn from(v: Value) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<bool> for JSONGetTextValue<'static>

source§

fn from(v: bool) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<f32> for JSONGetTextValue<'static>

source§

fn from(v: f32) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<f64> for JSONGetTextValue<'static>

source§

fn from(v: f64) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<i16> for JSONGetTextValue<'static>

source§

fn from(v: i16) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<i32> for JSONGetTextValue<'static>

source§

fn from(v: i32) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<i64> for JSONGetTextValue<'static>

source§

fn from(v: i64) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<i8> for JSONGetTextValue<'static>

source§

fn from(v: i8) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<isize> for JSONGetTextValue<'static>

source§

fn from(v: isize) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<u16> for JSONGetTextValue<'static>

source§

fn from(v: u16) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<u32> for JSONGetTextValue<'static>

source§

fn from(v: u32) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<u64> for JSONGetTextValue<'static>

source§

fn from(v: u64) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<u8> for JSONGetTextValue<'static>

source§

fn from(v: u8) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl From<usize> for JSONGetTextValue<'static>

source§

fn from(v: usize) -> JSONGetTextValue<'static>

Converts to this type from the input type.
source§

impl FromStr for JSONGetTextValue<'static>

§

type Err = ()

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<'a> PartialEq<JSONGetTextValue<'a>> for &'a str

source§

fn eq(&self, other: &JSONGetTextValue<'_>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<JSONGetTextValue<'a>> for str

source§

fn eq(&self, other: &JSONGetTextValue<'_>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<str> for JSONGetTextValue<'a>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq for JSONGetTextValue<'a>

source§

fn eq(&self, other: &JSONGetTextValue<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Serialize for JSONGetTextValue<'a>

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 TryFrom<i128> for JSONGetTextValue<'static>

§

type Error = JSONGetTextValueError

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

fn try_from(v: i128) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>

Performs the conversion.
source§

impl TryFrom<u128> for JSONGetTextValue<'static>

§

type Error = JSONGetTextValueError

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

fn try_from(v: u128) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>

Performs the conversion.
source§

impl<'a> Eq for JSONGetTextValue<'a>

source§

impl<'a> StructuralEq for JSONGetTextValue<'a>

source§

impl<'a> StructuralPartialEq for JSONGetTextValue<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for JSONGetTextValue<'a>

§

impl<'a> Send for JSONGetTextValue<'a>

§

impl<'a> Sync for JSONGetTextValue<'a>

§

impl<'a> Unpin for JSONGetTextValue<'a>

§

impl<'a> UnwindSafe for JSONGetTextValue<'a>

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> 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,

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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>,

§

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.