Struct holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::dependencies::serde_json::ser::PrettyFormatter
source · pub struct PrettyFormatter<'a> { /* private fields */ }
Expand description
This structure pretty prints a JSON value to make it human readable.
Implementations§
source§impl<'a> PrettyFormatter<'a>
impl<'a> PrettyFormatter<'a>
sourcepub fn new() -> PrettyFormatter<'a>
pub fn new() -> PrettyFormatter<'a>
Construct a pretty printer formatter that defaults to using two spaces for indentation.
sourcepub fn with_indent(indent: &'a [u8]) -> PrettyFormatter<'a>
pub fn with_indent(indent: &'a [u8]) -> PrettyFormatter<'a>
Construct a pretty printer formatter that uses the indent
string for indentation.
Trait Implementations§
source§impl<'a> Clone for PrettyFormatter<'a>
impl<'a> Clone for PrettyFormatter<'a>
source§fn clone(&self) -> PrettyFormatter<'a>
fn clone(&self) -> PrettyFormatter<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for PrettyFormatter<'a>
impl<'a> Debug for PrettyFormatter<'a>
source§impl<'a> Default for PrettyFormatter<'a>
impl<'a> Default for PrettyFormatter<'a>
source§fn default() -> PrettyFormatter<'a>
fn default() -> PrettyFormatter<'a>
Returns the “default value” for a type. Read more
source§impl<'a> Formatter for PrettyFormatter<'a>
impl<'a> Formatter for PrettyFormatter<'a>
source§fn begin_array<W>(&mut self, writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn begin_array<W>(&mut self, writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called before every array. Writes a
[
to the specified
writer.source§fn end_array<W>(&mut self, writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn end_array<W>(&mut self, writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called after every array. Writes a
]
to the specified
writer.source§fn begin_array_value<W>(
&mut self,
writer: &mut W,
first: bool
) -> Result<(), Error>where
W: Write + ?Sized,
fn begin_array_value<W>( &mut self, writer: &mut W, first: bool ) -> Result<(), Error>where W: Write + ?Sized,
Called before every array value. Writes a
,
if needed to
the specified writer.source§fn end_array_value<W>(&mut self, _writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn end_array_value<W>(&mut self, _writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called after every array value.
source§fn begin_object<W>(&mut self, writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn begin_object<W>(&mut self, writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called before every object. Writes a
{
to the specified
writer.source§fn end_object<W>(&mut self, writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn end_object<W>(&mut self, writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called after every object. Writes a
}
to the specified
writer.source§fn begin_object_key<W>(
&mut self,
writer: &mut W,
first: bool
) -> Result<(), Error>where
W: Write + ?Sized,
fn begin_object_key<W>( &mut self, writer: &mut W, first: bool ) -> Result<(), Error>where W: Write + ?Sized,
Called before every object key.
source§fn begin_object_value<W>(&mut self, writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn begin_object_value<W>(&mut self, writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called before every object value. A
:
should be written to
the specified writer by either this method or
end_object_key
.source§fn end_object_value<W>(&mut self, _writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn end_object_value<W>(&mut self, _writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called after every object value.
source§fn write_null<W>(&mut self, writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn write_null<W>(&mut self, writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Writes a
null
value to the specified writer.source§fn write_bool<W>(&mut self, writer: &mut W, value: bool) -> Result<(), Error>where
W: Write + ?Sized,
fn write_bool<W>(&mut self, writer: &mut W, value: bool) -> Result<(), Error>where W: Write + ?Sized,
Writes a
true
or false
value to the specified writer.source§fn write_i8<W>(&mut self, writer: &mut W, value: i8) -> Result<(), Error>where
W: Write + ?Sized,
fn write_i8<W>(&mut self, writer: &mut W, value: i8) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
-123
to the specified writer.source§fn write_i16<W>(&mut self, writer: &mut W, value: i16) -> Result<(), Error>where
W: Write + ?Sized,
fn write_i16<W>(&mut self, writer: &mut W, value: i16) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
-123
to the specified writer.source§fn write_i32<W>(&mut self, writer: &mut W, value: i32) -> Result<(), Error>where
W: Write + ?Sized,
fn write_i32<W>(&mut self, writer: &mut W, value: i32) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
-123
to the specified writer.source§fn write_i64<W>(&mut self, writer: &mut W, value: i64) -> Result<(), Error>where
W: Write + ?Sized,
fn write_i64<W>(&mut self, writer: &mut W, value: i64) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
-123
to the specified writer.source§fn write_i128<W>(&mut self, writer: &mut W, value: i128) -> Result<(), Error>where
W: Write + ?Sized,
fn write_i128<W>(&mut self, writer: &mut W, value: i128) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
-123
to the specified writer.source§fn write_u8<W>(&mut self, writer: &mut W, value: u8) -> Result<(), Error>where
W: Write + ?Sized,
fn write_u8<W>(&mut self, writer: &mut W, value: u8) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
123
to the specified writer.source§fn write_u16<W>(&mut self, writer: &mut W, value: u16) -> Result<(), Error>where
W: Write + ?Sized,
fn write_u16<W>(&mut self, writer: &mut W, value: u16) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
123
to the specified writer.source§fn write_u32<W>(&mut self, writer: &mut W, value: u32) -> Result<(), Error>where
W: Write + ?Sized,
fn write_u32<W>(&mut self, writer: &mut W, value: u32) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
123
to the specified writer.source§fn write_u64<W>(&mut self, writer: &mut W, value: u64) -> Result<(), Error>where
W: Write + ?Sized,
fn write_u64<W>(&mut self, writer: &mut W, value: u64) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
123
to the specified writer.source§fn write_u128<W>(&mut self, writer: &mut W, value: u128) -> Result<(), Error>where
W: Write + ?Sized,
fn write_u128<W>(&mut self, writer: &mut W, value: u128) -> Result<(), Error>where W: Write + ?Sized,
Writes an integer value like
123
to the specified writer.source§fn write_f32<W>(&mut self, writer: &mut W, value: f32) -> Result<(), Error>where
W: Write + ?Sized,
fn write_f32<W>(&mut self, writer: &mut W, value: f32) -> Result<(), Error>where W: Write + ?Sized,
Writes a floating point value like
-31.26e+12
to the specified writer.source§fn write_f64<W>(&mut self, writer: &mut W, value: f64) -> Result<(), Error>where
W: Write + ?Sized,
fn write_f64<W>(&mut self, writer: &mut W, value: f64) -> Result<(), Error>where W: Write + ?Sized,
Writes a floating point value like
-31.26e+12
to the specified writer.source§fn write_number_str<W>(
&mut self,
writer: &mut W,
value: &str
) -> Result<(), Error>where
W: Write + ?Sized,
fn write_number_str<W>( &mut self, writer: &mut W, value: &str ) -> Result<(), Error>where W: Write + ?Sized,
Writes a number that has already been rendered to a string.
source§fn begin_string<W>(&mut self, writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn begin_string<W>(&mut self, writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called before each series of
write_string_fragment
and
write_char_escape
. Writes a "
to the specified writer.source§fn end_string<W>(&mut self, writer: &mut W) -> Result<(), Error>where
W: Write + ?Sized,
fn end_string<W>(&mut self, writer: &mut W) -> Result<(), Error>where W: Write + ?Sized,
Called after each series of
write_string_fragment
and
write_char_escape
. Writes a "
to the specified writer.source§fn write_string_fragment<W>(
&mut self,
writer: &mut W,
fragment: &str
) -> Result<(), Error>where
W: Write + ?Sized,
fn write_string_fragment<W>( &mut self, writer: &mut W, fragment: &str ) -> Result<(), Error>where W: Write + ?Sized,
Writes a string fragment that doesn’t need any escaping to the
specified writer.
source§fn write_char_escape<W>(
&mut self,
writer: &mut W,
char_escape: CharEscape
) -> Result<(), Error>where
W: Write + ?Sized,
fn write_char_escape<W>( &mut self, writer: &mut W, char_escape: CharEscape ) -> Result<(), Error>where W: Write + ?Sized,
Writes a character escape code to the specified writer.
source§fn write_byte_array<W>(
&mut self,
writer: &mut W,
value: &[u8]
) -> Result<(), Error>where
W: Write + ?Sized,
fn write_byte_array<W>( &mut self, writer: &mut W, value: &[u8] ) -> Result<(), Error>where W: Write + ?Sized,
Writes the representation of a byte array. Formatters can choose whether
to represent bytes as a JSON array of integers (the default), or some
JSON string encoding like hex or base64.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for PrettyFormatter<'a>
impl<'a> Send for PrettyFormatter<'a>
impl<'a> Sync for PrettyFormatter<'a>
impl<'a> Unpin for PrettyFormatter<'a>
impl<'a> UnwindSafe for PrettyFormatter<'a>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref