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>
impl<'a, const N: usize> ArrayJsonObject<'a, N>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
convenience method to initialize a new array & call JsonObject::wrap on it
Sourcepub fn new_parsed(
data: &'a [u8],
escape_buffer: &'a mut [u8],
) -> Result<(usize, Self), JsonParseFailure>
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
Sourcepub const fn push_const(
&mut self,
key: &'a str,
value: JsonValue<'a>,
) -> Result<(), ()>
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
Sourcepub const fn pop_const(&mut self) -> Option<&JsonField<'a, 'a>>
pub const fn pop_const(&mut self) -> Option<&JsonField<'a, 'a>>
similar to JsonObject::pop but supports const contexts
Sourcepub const fn fields_const(&self) -> &[JsonField<'a, 'a>]
pub const fn fields_const(&self) -> &[JsonField<'a, 'a>]
same as JsonObject::fields but supports const contexts
Sourcepub const fn fields_mut_const(&mut self) -> &mut [JsonField<'a, 'a>]
pub const fn fields_mut_const(&mut self) -> &mut [JsonField<'a, 'a>]
same as JsonObject::fields_mut but supports const contexts