Enum json_syntax::StrippedFragmentRef
source · Variants§
Implementations§
source§impl<'a, M> StrippedFragmentRef<'a, M>
impl<'a, M> StrippedFragmentRef<'a, M>
pub fn is_entry(&self) -> bool
pub fn is_key(&self) -> bool
pub fn is_value(&self) -> bool
pub fn is_null(&self) -> bool
pub fn is_number(&self) -> bool
pub fn is_string(&self) -> bool
sourcepub fn is_array(&self) -> bool
pub fn is_array(&self) -> bool
Examples found in repository?
src/print.rs (line 799)
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811
fn fmt_with(&self, f: &mut fmt::Formatter, options: &Options, indent: usize) -> fmt::Result {
match self {
Self::Null => f.write_str("null"),
Self::Boolean(b) => b.fmt_with(f, options, indent),
Self::Number(n) => n.fmt_with(f, options, indent),
Self::String(s) => s.fmt_with(f, options, indent),
Self::Array(a) => {
let mut sizes = Vec::with_capacity(self.count(|v| v.is_array() || v.is_object()));
self.pre_compute_size(options, &mut sizes);
let mut index = 0;
a.fmt_with_size(f, options, indent, &sizes, &mut index)
}
Self::Object(o) => {
let mut sizes = Vec::with_capacity(self.count(|v| v.is_array() || v.is_object()));
self.pre_compute_size(options, &mut sizes);
let mut index = 0;
o.fmt_with_size(f, options, indent, &sizes, &mut index)
}
}
}
sourcepub fn is_object(&self) -> bool
pub fn is_object(&self) -> bool
Examples found in repository?
src/print.rs (line 799)
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811
fn fmt_with(&self, f: &mut fmt::Formatter, options: &Options, indent: usize) -> fmt::Result {
match self {
Self::Null => f.write_str("null"),
Self::Boolean(b) => b.fmt_with(f, options, indent),
Self::Number(n) => n.fmt_with(f, options, indent),
Self::String(s) => s.fmt_with(f, options, indent),
Self::Array(a) => {
let mut sizes = Vec::with_capacity(self.count(|v| v.is_array() || v.is_object()));
self.pre_compute_size(options, &mut sizes);
let mut index = 0;
a.fmt_with_size(f, options, indent, &sizes, &mut index)
}
Self::Object(o) => {
let mut sizes = Vec::with_capacity(self.count(|v| v.is_array() || v.is_object()));
self.pre_compute_size(options, &mut sizes);
let mut index = 0;
o.fmt_with_size(f, options, indent, &sizes, &mut index)
}
}
}