pub struct JsonObject<'a, const MAX_FIELDS: usize> { /* private fields */ }Expand description
a JSON object that can hold up to MAX_FIELDS fields
Implementations§
Source§impl<'a, const MAX_FIELDS: usize> JsonObject<'a, MAX_FIELDS>
impl<'a, const MAX_FIELDS: usize> JsonObject<'a, MAX_FIELDS>
pub const fn new() -> Self
pub const fn as_slice(&self) -> &[JsonField<'a, 'a>]
pub const fn as_mut_slice(&mut self) -> &mut [JsonField<'a, 'a>]
pub const fn push<'x: 'a, 'y: 'a>( &mut self, field: JsonField<'x, 'y>, ) -> Result<(), JsonField<'x, 'y>>
pub fn pop(&mut self) -> Option<JsonField<'a, 'a>>
pub const fn push_field( &mut self, key: &'a str, value: JsonValue<'a>, ) -> Result<(), ()>
pub fn parse_from(data: &'a [u8]) -> Result<(usize, Self), JsonParseFailure>
pub fn serialize_blocking<T: Write>(&self, output: T) -> Result<usize, T::Error>
Trait Implementations§
Source§impl<'a, const MAX_FIELDS: usize> Debug for JsonObject<'a, MAX_FIELDS>
impl<'a, const MAX_FIELDS: usize> Debug for JsonObject<'a, MAX_FIELDS>
Auto Trait Implementations§
impl<'a, const MAX_FIELDS: usize> Freeze for JsonObject<'a, MAX_FIELDS>
impl<'a, const MAX_FIELDS: usize> RefUnwindSafe for JsonObject<'a, MAX_FIELDS>
impl<'a, const MAX_FIELDS: usize> Send for JsonObject<'a, MAX_FIELDS>
impl<'a, const MAX_FIELDS: usize> Sync for JsonObject<'a, MAX_FIELDS>
impl<'a, const MAX_FIELDS: usize> Unpin for JsonObject<'a, MAX_FIELDS>
impl<'a, const MAX_FIELDS: usize> UnwindSafe for JsonObject<'a, MAX_FIELDS>
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