pub enum JsonValue<'s> {
Null,
Bool(bool),
Int(i64),
BigInt(BigInt),
Float(f64),
Str(Cow<'s, str>),
Array(JsonArray<'s>),
Object(JsonObject<'s>),
}
Expand description
Enum representing a JSON value.
Variants§
Null
Bool(bool)
Int(i64)
BigInt(BigInt)
Float(f64)
Str(Cow<'s, str>)
Array(JsonArray<'s>)
Object(JsonObject<'s>)
Implementations§
source§impl<'j> JsonValue<'j>
impl<'j> JsonValue<'j>
sourcepub fn parse(data: &'j [u8], allow_inf_nan: bool) -> Result<Self, JsonError>
pub fn parse(data: &'j [u8], allow_inf_nan: bool) -> Result<Self, JsonError>
Parse a JSON enum from a byte slice, returning a borrowed version of the enum - e.g. strings can be references into the original byte slice.
sourcepub fn into_static(self) -> JsonValue<'static>
pub fn into_static(self) -> JsonValue<'static>
Convert a borrowed JSON enum into an owned JSON enum.
Trait Implementations§
source§impl<'s> PartialEq for JsonValue<'s>
impl<'s> PartialEq for JsonValue<'s>
source§impl ToPyObject for JsonValue<'_>
impl ToPyObject for JsonValue<'_>
impl<'s> StructuralPartialEq for JsonValue<'s>
Auto Trait Implementations§
impl<'s> Freeze for JsonValue<'s>
impl<'s> RefUnwindSafe for JsonValue<'s>
impl<'s> Send for JsonValue<'s>
impl<'s> Sync for JsonValue<'s>
impl<'s> Unpin for JsonValue<'s>
impl<'s> UnwindSafe for JsonValue<'s>
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