pub struct Json(/* private fields */);Implementations§
Source§impl Json
impl Json
Sourcepub fn check_schema(&self, schema: &Json, errors: &mut Vec<JsonMessage>) -> bool
pub fn check_schema(&self, schema: &Json, errors: &mut Vec<JsonMessage>) -> bool
Check this value against a qpdf JSON schema with no flags.
Sourcepub fn check_schema_with_flags(
&self,
schema: &Json,
flags: SchemaFlags,
errors: &mut Vec<JsonMessage>,
) -> bool
pub fn check_schema_with_flags( &self, schema: &Json, flags: SchemaFlags, errors: &mut Vec<JsonMessage>, ) -> bool
Check this value against a qpdf JSON schema.
Source§impl Json
impl Json
pub const LATEST: i32 = 2
pub fn make_dictionary() -> Self
pub fn add_dictionary_member( &self, key: impl AsRef<[u8]>, value: Json, ) -> Result<Json, JsonError>
pub fn make_array() -> Self
pub fn add_array_element(&self, value: Json) -> Result<Json, JsonError>
pub fn make_string(value: impl AsRef<[u8]>) -> Self
pub fn make_int(value: i64) -> Self
pub fn make_real(value: f64) -> Self
pub fn make_number(encoded: impl AsRef<[u8]>) -> Self
pub fn make_bool(value: bool) -> Self
pub fn make_null() -> Self
pub fn make_blob( callback: impl Fn(&mut dyn Pipeline) -> PipelineResult<()> + 'static, ) -> Self
pub fn is_array(&self) -> bool
pub fn is_dictionary(&self) -> bool
pub fn check_dictionary_key_seen( &self, key: impl AsRef<[u8]>, ) -> Result<bool, JsonError>
pub fn get_string(&self) -> Option<Vec<u8>>
pub fn get_number(&self) -> Option<Vec<u8>>
pub fn get_bool(&self) -> Option<bool>
pub fn is_null(&self) -> bool
pub fn get_dict_item(&self, encoded_key: impl AsRef<[u8]>) -> Json
pub fn for_each_dict_item(&self, callback: impl FnMut(&[u8], Json)) -> bool
pub fn for_each_array_item(&self, callback: impl FnMut(Json)) -> bool
pub fn set_start(&self, start: i64)
pub fn set_end(&self, end: i64)
pub fn start(&self) -> i64
pub fn end(&self) -> i64
Source§impl Json
impl Json
pub fn write_dictionary_open( out: &mut dyn Pipeline, first: &mut bool, _depth: usize, ) -> PipelineResult<()>
pub fn write_array_open( out: &mut dyn Pipeline, first: &mut bool, _depth: usize, ) -> PipelineResult<()>
pub fn write_dictionary_close( out: &mut dyn Pipeline, first: bool, depth: usize, ) -> PipelineResult<()>
pub fn write_array_close( out: &mut dyn Pipeline, first: bool, depth: usize, ) -> PipelineResult<()>
pub fn write_dictionary_item( out: &mut dyn Pipeline, first: &mut bool, key: &[u8], value: &Json, depth: usize, ) -> PipelineResult<()>
pub fn write_dictionary_key( out: &mut dyn Pipeline, first: &mut bool, encoded_key: &[u8], depth: usize, ) -> PipelineResult<()>
pub fn write_array_item( out: &mut dyn Pipeline, first: &mut bool, value: &Json, depth: usize, ) -> PipelineResult<()>
pub fn write_next( out: &mut dyn Pipeline, first: &mut bool, depth: usize, ) -> PipelineResult<()>
pub fn write(&self, out: &mut dyn Pipeline, depth: usize) -> PipelineResult<()>
pub fn unparse(&self) -> PipelineResult<Vec<u8>>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Json
impl !Send for Json
impl !Sync for Json
impl !UnwindSafe for Json
impl Freeze for Json
impl Unpin for Json
impl UnsafeUnpin for Json
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