pub struct JSONText {
pub value: JSONValue,
pub context: Option<JSONTextContext>,
}
Expand description
Represents the top-level Text production of a JSON5 document.
use json_five::rt::parser::from_str;
use json_five::rt::parser::JSONValue;
let doc = from_str(" 'foo'\n").unwrap();
let context = doc.context.unwrap();
assert_eq!(&context.wsc.0, " ");
assert_eq!(doc.value, JSONValue::SingleQuotedString("foo".to_string()));
assert_eq!(&context.wsc.1, "\n");
Fields§
§value: JSONValue
Can be any JSONValue except for JSONValue::Identifier (which is reserved for keys only)
context: Option<JSONTextContext>
Contextual whitespace
Trait Implementations§
impl StructuralPartialEq for JSONText
Auto Trait Implementations§
impl Freeze for JSONText
impl RefUnwindSafe for JSONText
impl Send for JSONText
impl Sync for JSONText
impl Unpin for JSONText
impl UnwindSafe for JSONText
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