ArrayJsonObject

Type Alias ArrayJsonObject 

Source
pub type ArrayJsonObject<'a, const N: usize> = JsonObject<[JsonField<'a, 'a>; N]>;
Expand description

ArrayJsonObject is a type alias for a JsonObject that wraps an array. It has extra functionality when compared to any other type of JsonObject.

Aliased Type§

pub struct ArrayJsonObject<'a, const N: usize> { /* private fields */ }

Implementations§

Source§

impl<'a, const N: usize> ArrayJsonObject<'a, N>

Source

pub const fn new() -> Self

convenience method to initialize a new array & call JsonObject::wrap on it

Source

pub fn new_parsed( data: &'a [u8], escape_buffer: &'a mut [u8], ) -> Result<(usize, Self), JsonParseFailure>

convenience method to automatically create an ArrayJsonObject if object parsing is successful

Source

pub const fn push_const( &mut self, key: &'a str, value: JsonValue<'a>, ) -> Result<(), ()>

similar to JsonObject::push but supports const contexts & only returns a reference

Source

pub const fn pop_const(&mut self) -> Option<&JsonField<'a, 'a>>

similar to JsonObject::pop but supports const contexts

Source

pub const fn fields_const(&self) -> &[JsonField<'a, 'a>]

same as JsonObject::fields but supports const contexts

Source

pub const fn fields_mut_const(&mut self) -> &mut [JsonField<'a, 'a>]

same as JsonObject::fields_mut but supports const contexts