#[repr(C)]pub struct playdate_json {
pub initEncoder: Option<unsafe extern "C" fn(encoder: *mut json_encoder, write: json_writeFunc, userdata: *mut c_void, pretty: c_int)>,
pub decode: Option<unsafe extern "C" fn(functions: *mut json_decoder, reader: json_reader, outval: *mut json_value) -> c_int>,
pub decodeString: Option<unsafe extern "C" fn(functions: *mut json_decoder, jsonString: *const c_char, outval: *mut json_value) -> c_int>,
}Fields§
§initEncoder: Option<unsafe extern "C" fn(encoder: *mut json_encoder, write: json_writeFunc, userdata: *mut c_void, pretty: c_int)>void playdate->json->initEncoder(json_encoder* encoder, writeFunc* write, void* userdata, int pretty);
Populates the given json_encoder encoder with the functions necessary to encode arbitrary data into a JSON string. userdata is passed as the first argument of the given writeFunc write. When pretty is 1 the string is written with human-readable formatting.
decode: Option<unsafe extern "C" fn(functions: *mut json_decoder, reader: json_reader, outval: *mut json_value) -> c_int>int playdate->json->decode(struct json_decoder* decoder, json_reader reader, json_value* outval);
Equivalent to playdate.json.decode() in the Lua API.
decodeString: Option<unsafe extern "C" fn(functions: *mut json_decoder, jsonString: *const c_char, outval: *mut json_value) -> c_int>int playdate->json->decodeString(struct json_decoder* decoder, const char* jsonString, json_value* outval);
Decodes a JSON file or string with the given decoder. An instance of json_decoder must implement decodeError. The remaining functions are optional although you’ll probably want to implement at least didDecodeTableValue and didDecodeArrayValue. The outval pointer, if set, contains the value retured from the top-level didDecodeSublist callback.
Trait Implementations§
Source§impl Clone for playdate_json
impl Clone for playdate_json
Source§fn clone(&self) -> playdate_json
fn clone(&self) -> playdate_json
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for playdate_json
impl Debug for playdate_json
Source§impl Default for playdate_json
impl Default for playdate_json
Source§fn default() -> playdate_json
fn default() -> playdate_json
Source§impl Hash for playdate_json
impl Hash for playdate_json
Source§impl Ord for playdate_json
impl Ord for playdate_json
Source§impl PartialEq for playdate_json
impl PartialEq for playdate_json
Source§impl PartialOrd for playdate_json
impl PartialOrd for playdate_json
Source§fn partial_cmp(&self, other: &playdate_json) -> Option<Ordering>
fn partial_cmp(&self, other: &playdate_json) -> Option<Ordering>
impl Copy for playdate_json
impl Eq for playdate_json
impl StructuralPartialEq for playdate_json
Auto Trait Implementations§
impl Freeze for playdate_json
impl RefUnwindSafe for playdate_json
impl Send for playdate_json
impl Sync for playdate_json
impl Unpin for playdate_json
impl UnwindSafe for playdate_json
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 12 bytes