pub struct JsonSerializer<'a, W: Write> { /* private fields */ }
Expand description

Serialize bin values to JSON

Implementations§

source§

impl<'a, W: Write> JsonSerializer<'a, W>

source

pub fn new(writer: W, hmappers: &'a BinHashMappers) -> Self

Create a new serializer

Trait Implementations§

source§

impl<'a, W: Write> BinSerializer for JsonSerializer<'a, W>

§

type EntriesSerializer = JsonEntriesSerializer<'a, W>

source§

fn write_entry(&mut self, v: &BinEntry) -> Result<()>

Write a single entry
source§

fn write_entries(self) -> Result<Self::EntriesSerializer>

Return a serializer to write streamed entries
source§

fn write_none(&mut self, _: &BinNone) -> Result<()>

source§

fn write_bool(&mut self, v: &BinBool) -> Result<()>

source§

fn write_s8(&mut self, v: &BinS8) -> Result<()>

source§

fn write_u8(&mut self, v: &BinU8) -> Result<()>

source§

fn write_s16(&mut self, v: &BinS16) -> Result<()>

source§

fn write_u16(&mut self, v: &BinU16) -> Result<()>

source§

fn write_s32(&mut self, v: &BinS32) -> Result<()>

source§

fn write_u32(&mut self, v: &BinU32) -> Result<()>

source§

fn write_s64(&mut self, v: &BinS64) -> Result<()>

source§

fn write_u64(&mut self, v: &BinU64) -> Result<()>

source§

fn write_float(&mut self, v: &BinFloat) -> Result<()>

source§

fn write_vec2(&mut self, v: &BinVec2) -> Result<()>

source§

fn write_vec3(&mut self, v: &BinVec3) -> Result<()>

source§

fn write_vec4(&mut self, v: &BinVec4) -> Result<()>

source§

fn write_matrix(&mut self, v: &BinMatrix) -> Result<()>

source§

fn write_color(&mut self, v: &BinColor) -> Result<()>

source§

fn write_string(&mut self, v: &BinString) -> Result<()>

source§

fn write_hash(&mut self, v: &BinHash) -> Result<()>

source§

fn write_path(&mut self, v: &BinPath) -> Result<()>

source§

fn write_flag(&mut self, v: &BinFlag) -> Result<()>

source§

fn write_list(&mut self, v: &BinList) -> Result<()>

source§

fn write_struct(&mut self, v: &BinStruct) -> Result<()>

source§

fn write_embed(&mut self, v: &BinEmbed) -> Result<()>

source§

fn write_option(&mut self, option: &BinOption) -> Result<()>

source§

fn write_map(&mut self, map: &BinMap) -> Result<()>

source§

fn write_binfile(self, v: &PropFile) -> Result<()>
where Self: Sized,

Write entries from a PropFile
source§

impl<'a, W: Debug + Write> Debug for JsonSerializer<'a, W>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, W> RefUnwindSafe for JsonSerializer<'a, W>
where W: RefUnwindSafe,

§

impl<'a, W> Send for JsonSerializer<'a, W>
where W: Send,

§

impl<'a, W> Sync for JsonSerializer<'a, W>
where W: Sync,

§

impl<'a, W> Unpin for JsonSerializer<'a, W>
where W: Unpin,

§

impl<'a, W> UnwindSafe for JsonSerializer<'a, W>
where W: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V