Struct minicbor::encode::Encoder [−][src]
pub struct Encoder<W> { /* fields omitted */ }
Expand description
A non-allocating CBOR encoder writing encoded bytes to the given Write
sink.
Implementations
Get back the Write
impl.
Encode any type that implements Encode
.
Encode a CBOR undefined
value.
Encode a CBOR simple value.
Encode an f32
value as a half float (f16)
.
Requires feature "half"
.
NB: The conversion from f32
to f16
is potentially lossy.
Generally values are truncated and rounded to the nearest 16-bit
value, except:
- 32-bit values which do not fit into 16 bit become ±∞.
- 32-bit subnormal values become ±0.
- Exponents smaller than the min. 16-bit exponent become 16-bit subnormals or ±0.
For further details please consult the half crate which is
used internally for f16
support.
Begin encoding an array with len
elements.
Begin encoding a map with len
entries.
Begin encoding an array of unknown size.
Use Encoder::end
to terminate the array.
Begin encoding an indefinite number of byte slices.
Use Encoder::end
to terminate.
Begin encoding a map of unknown size.
Use Encoder::end
to terminate the map.
Begin encoding an indefinite number of string slices.
Use Encoder::end
to terminate.
Trait Implementations
Auto Trait Implementations
impl<W> RefUnwindSafe for Encoder<W> where
W: RefUnwindSafe,
impl<W> UnwindSafe for Encoder<W> where
W: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more