sonic_rs

Trait JsonInput

Source
pub trait JsonInput<'de>: Sealed {
    // Required methods
    fn need_utf8_valid(&self) -> bool;
    fn to_json_slice(&self) -> JsonSlice<'de>;
    fn from_subset(&self, sub: &'de [u8]) -> JsonSlice<'de>;
    fn to_u8_slice(&self) -> &'de [u8] ;
}
Expand description

A trait for string/bytes-like types that can be parsed into JSON.

Required Methods§

Source

fn need_utf8_valid(&self) -> bool

Source

fn to_json_slice(&self) -> JsonSlice<'de>

Source

fn from_subset(&self, sub: &'de [u8]) -> JsonSlice<'de>

Source

fn to_u8_slice(&self) -> &'de [u8]

Implementations on Foreign Types§

Source§

impl<'de> JsonInput<'de> for &'de str

Source§

fn need_utf8_valid(&self) -> bool

Source§

fn to_json_slice(&self) -> JsonSlice<'de>

Source§

fn from_subset(&self, sub: &'de [u8]) -> JsonSlice<'de>

Source§

fn to_u8_slice(&self) -> &'de [u8]

Source§

impl<'de> JsonInput<'de> for &'de String

Source§

fn need_utf8_valid(&self) -> bool

Source§

fn to_json_slice(&self) -> JsonSlice<'de>

Source§

fn from_subset(&self, sub: &'de [u8]) -> JsonSlice<'de>

Source§

fn to_u8_slice(&self) -> &'de [u8]

Source§

impl<'de> JsonInput<'de> for &'de Bytes

Source§

fn need_utf8_valid(&self) -> bool

Source§

fn to_json_slice(&self) -> JsonSlice<'de>

Source§

fn from_subset(&self, sub: &'de [u8]) -> JsonSlice<'de>

Source§

fn to_u8_slice(&self) -> &'de [u8]

Source§

impl<'de> JsonInput<'de> for &'de [u8]

Source§

fn need_utf8_valid(&self) -> bool

Source§

fn to_json_slice(&self) -> JsonSlice<'de>

Source§

fn from_subset(&self, sub: &'de [u8]) -> JsonSlice<'de>

Source§

fn to_u8_slice(&self) -> &'de [u8]

Implementors§

Source§

impl<'de> JsonInput<'de> for &'de FastStr