pub enum JsonValue<'a> {
Array(&'a Vec<ValueType>),
Object(&'a Vec<(&'a str, &'a ValueType)>),
ObjectArray(&'a Vec<Vec<(&'a str, &'a ValueType)>>),
Initial(&'a ValueType),
MysqlJsonObject(&'a Vec<(&'a str, &'a ValueType)>),
}
Expand description
Enum that benefits you to add json values to structs. They can be used with json functions. That variants represents that kind of json values:
Variants§
Array(&'a Vec<ValueType>)
Example Value: [“hello”, 21, “again”]
Object(&'a Vec<(&'a str, &'a ValueType)>)
Example Value: {“name”: “necdet”, “message”: “hello”, “id”: 1}
ObjectArray(&'a Vec<Vec<(&'a str, &'a ValueType)>>)
example value: [{“name”: “necdet”, “message”: “hello”, “id”: 1}, {“name”: “kemal”, “message”: “hi”, “id”: 2}]
Initial(&'a ValueType)
It’s same with ValueType
enums, just for simply passing it to that enum.
MysqlJsonObject(&'a Vec<(&'a str, &'a ValueType)>)
Mysql Json Object: It writes JSON_OBJECT() mysql function with it’s synthax, such as: JSON_OBJECT(‘name’, ‘necdet’, ‘message’, ‘hello’, ‘id’, 13). It’s necessary or more accurate when working most of the json functions.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for JsonValue<'a>
impl<'a> RefUnwindSafe for JsonValue<'a>
impl<'a> Send for JsonValue<'a>
impl<'a> Sync for JsonValue<'a>
impl<'a> Unpin for JsonValue<'a>
impl<'a> UnwindSafe for JsonValue<'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