Enum json_gettext::JSONGetTextValue
source · 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§
Implementations§
source§impl<'a> JSONGetTextValue<'a>
impl<'a> JSONGetTextValue<'a>
pub fn from_str<S: AsRef<str> + ?Sized>(s: &'a S) -> JSONGetTextValue<'a>
pub fn from_string<S: Into<String>>(s: S) -> JSONGetTextValue<'static>
pub fn from_json_str<S: AsRef<str>>( s: S ) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>
pub fn from_bool(b: bool) -> JSONGetTextValue<'static>
pub fn from_i8(n: i8) -> JSONGetTextValue<'static>
pub fn from_i16(n: i16) -> JSONGetTextValue<'static>
pub fn from_i32(n: i32) -> JSONGetTextValue<'static>
pub fn from_i64(n: i64) -> JSONGetTextValue<'static>
pub fn from_i128( n: i128 ) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>
pub fn from_isize(n: isize) -> JSONGetTextValue<'static>
pub fn from_u8(n: u8) -> JSONGetTextValue<'static>
pub fn from_u16(n: u16) -> JSONGetTextValue<'static>
pub fn from_u32(n: u32) -> JSONGetTextValue<'static>
pub fn from_u64(n: u64) -> JSONGetTextValue<'static>
pub fn from_u128( n: u128 ) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>
pub fn from_usize(n: usize) -> JSONGetTextValue<'static>
pub fn from_f32(n: f32) -> JSONGetTextValue<'static>
pub fn from_f64(n: f64) -> JSONGetTextValue<'static>
pub fn from_json_value(v: Value) -> JSONGetTextValue<'static>
pub fn from_json_value_ref(v: &'a Value) -> JSONGetTextValue<'a>
pub fn from_serializable<T: Serialize>( v: T ) -> Result<JSONGetTextValue<'static>, Error>
pub fn null() -> JSONGetTextValue<'static>
source§impl<'a> JSONGetTextValue<'a>
impl<'a> JSONGetTextValue<'a>
sourcepub fn to_json_string(&self) -> String
pub fn to_json_string(&self) -> String
Convert to a string for JSON format.
sourcepub fn to_json(&self) -> String
👎Deprecated since 3.2.0: Please use the to_json_string
function instead
pub fn to_json(&self) -> String
to_json_string
function insteadConvert to a string for JSON format.
sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Convert to a string slice if it is possible (if it is a string).
sourcepub fn clone_borrowed(&self) -> JSONGetTextValue<'_>
pub fn clone_borrowed(&self) -> JSONGetTextValue<'_>
Clone the reference of this JSONGetTextValue
instance.
source§impl<'a> JSONGetTextValue<'a>
impl<'a> JSONGetTextValue<'a>
pub fn parse_json<S: AsRef<str>>( s: S ) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>
Trait Implementations§
source§impl<'a> Clone for JSONGetTextValue<'a>
impl<'a> Clone for JSONGetTextValue<'a>
source§fn clone(&self) -> JSONGetTextValue<'a>
fn clone(&self) -> JSONGetTextValue<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for JSONGetTextValue<'a>
impl<'a> Debug for JSONGetTextValue<'a>
source§impl<'de> Deserialize<'de> for JSONGetTextValue<'de>
impl<'de> Deserialize<'de> for JSONGetTextValue<'de>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
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>
impl<'a> Display for JSONGetTextValue<'a>
source§impl<'a> From<&'a Value> for JSONGetTextValue<'a>
impl<'a> From<&'a Value> for JSONGetTextValue<'a>
source§fn from(v: &'a Value) -> JSONGetTextValue<'a>
fn from(v: &'a Value) -> JSONGetTextValue<'a>
Converts to this type from the input type.
source§impl<'a> From<&'a str> for JSONGetTextValue<'a>
impl<'a> From<&'a str> for JSONGetTextValue<'a>
source§fn from(v: &'a str) -> JSONGetTextValue<'a>
fn from(v: &'a str) -> JSONGetTextValue<'a>
Converts to this type from the input type.
source§impl From<String> for JSONGetTextValue<'static>
impl From<String> for JSONGetTextValue<'static>
source§fn from(v: String) -> JSONGetTextValue<'static>
fn from(v: String) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<Value> for JSONGetTextValue<'static>
impl From<Value> for JSONGetTextValue<'static>
source§fn from(v: Value) -> JSONGetTextValue<'static>
fn from(v: Value) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<bool> for JSONGetTextValue<'static>
impl From<bool> for JSONGetTextValue<'static>
source§fn from(v: bool) -> JSONGetTextValue<'static>
fn from(v: bool) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<f32> for JSONGetTextValue<'static>
impl From<f32> for JSONGetTextValue<'static>
source§fn from(v: f32) -> JSONGetTextValue<'static>
fn from(v: f32) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<f64> for JSONGetTextValue<'static>
impl From<f64> for JSONGetTextValue<'static>
source§fn from(v: f64) -> JSONGetTextValue<'static>
fn from(v: f64) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<i16> for JSONGetTextValue<'static>
impl From<i16> for JSONGetTextValue<'static>
source§fn from(v: i16) -> JSONGetTextValue<'static>
fn from(v: i16) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<i32> for JSONGetTextValue<'static>
impl From<i32> for JSONGetTextValue<'static>
source§fn from(v: i32) -> JSONGetTextValue<'static>
fn from(v: i32) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<i64> for JSONGetTextValue<'static>
impl From<i64> for JSONGetTextValue<'static>
source§fn from(v: i64) -> JSONGetTextValue<'static>
fn from(v: i64) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<i8> for JSONGetTextValue<'static>
impl From<i8> for JSONGetTextValue<'static>
source§fn from(v: i8) -> JSONGetTextValue<'static>
fn from(v: i8) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<isize> for JSONGetTextValue<'static>
impl From<isize> for JSONGetTextValue<'static>
source§fn from(v: isize) -> JSONGetTextValue<'static>
fn from(v: isize) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<u16> for JSONGetTextValue<'static>
impl From<u16> for JSONGetTextValue<'static>
source§fn from(v: u16) -> JSONGetTextValue<'static>
fn from(v: u16) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<u32> for JSONGetTextValue<'static>
impl From<u32> for JSONGetTextValue<'static>
source§fn from(v: u32) -> JSONGetTextValue<'static>
fn from(v: u32) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<u64> for JSONGetTextValue<'static>
impl From<u64> for JSONGetTextValue<'static>
source§fn from(v: u64) -> JSONGetTextValue<'static>
fn from(v: u64) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<u8> for JSONGetTextValue<'static>
impl From<u8> for JSONGetTextValue<'static>
source§fn from(v: u8) -> JSONGetTextValue<'static>
fn from(v: u8) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl From<usize> for JSONGetTextValue<'static>
impl From<usize> for JSONGetTextValue<'static>
source§fn from(v: usize) -> JSONGetTextValue<'static>
fn from(v: usize) -> JSONGetTextValue<'static>
Converts to this type from the input type.
source§impl FromStr for JSONGetTextValue<'static>
impl FromStr for JSONGetTextValue<'static>
source§impl<'a> PartialEq<JSONGetTextValue<'a>> for &'a str
impl<'a> PartialEq<JSONGetTextValue<'a>> for &'a str
source§fn eq(&self, other: &JSONGetTextValue<'_>) -> bool
fn eq(&self, other: &JSONGetTextValue<'_>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialEq<JSONGetTextValue<'a>> for str
impl<'a> PartialEq<JSONGetTextValue<'a>> for str
source§fn eq(&self, other: &JSONGetTextValue<'_>) -> bool
fn eq(&self, other: &JSONGetTextValue<'_>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialEq<str> for JSONGetTextValue<'a>
impl<'a> PartialEq<str> for JSONGetTextValue<'a>
source§impl<'a> PartialEq for JSONGetTextValue<'a>
impl<'a> PartialEq for JSONGetTextValue<'a>
source§fn eq(&self, other: &JSONGetTextValue<'a>) -> bool
fn eq(&self, other: &JSONGetTextValue<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> Serialize for JSONGetTextValue<'a>
impl<'a> Serialize for JSONGetTextValue<'a>
source§impl TryFrom<i128> for JSONGetTextValue<'static>
impl TryFrom<i128> for JSONGetTextValue<'static>
§type Error = JSONGetTextValueError
type Error = JSONGetTextValueError
The type returned in the event of a conversion error.
source§fn try_from(v: i128) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>
fn try_from(v: i128) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>
Performs the conversion.
source§impl TryFrom<u128> for JSONGetTextValue<'static>
impl TryFrom<u128> for JSONGetTextValue<'static>
§type Error = JSONGetTextValueError
type Error = JSONGetTextValueError
The type returned in the event of a conversion error.
source§fn try_from(v: u128) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>
fn try_from(v: u128) -> Result<JSONGetTextValue<'static>, JSONGetTextValueError>
Performs the conversion.
impl<'a> Eq for JSONGetTextValue<'a>
impl<'a> StructuralEq for JSONGetTextValue<'a>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more