pub struct Writer { /* private fields */ }Expand description
CBOR Data structure to write CBOR elements to a growing byte vector
Implementations
sourceimpl Writer
impl Writer
pub fn finalize_data(self) -> CborData
pub fn encode<T: Encode + ?Sized>(&mut self, t: &T)
sourcepub fn bytes<'a>(&mut self, d: &Bytes<'a>)
pub fn bytes<'a>(&mut self, d: &Bytes<'a>)
Append a Bytes value in the writer, depending of the Bytes CBOR encoding, it will be either represented as indefinite sequence of sequence bytes (terminated by CBOR break), or an immediate bytes sequence.
sourcepub fn text<'a>(&mut self, d: &Text<'a>)
pub fn text<'a>(&mut self, d: &Text<'a>)
Append a Text value in the writer, depending of the Text CBOR encoding, it will be either represented as indefinite sequence of sequence utf8 bytes (terminated by CBOR break), or an immediate utf8 bytes sequence.
sourcepub fn array_build<F>(&mut self, len: StructureLength, f: F) where
F: FnOnce(&mut Self),
pub fn array_build<F>(&mut self, len: StructureLength, f: F) where
F: FnOnce(&mut Self),
Append an Array in the writer using a closure
sourcepub fn map_build<F>(&mut self, len: StructureLength, f: F) where
F: FnOnce(&mut Self),
pub fn map_build<F>(&mut self, len: StructureLength, f: F) where
F: FnOnce(&mut Self),
Append a Map in the writer using a closure
sourcepub fn tag_build<F>(&mut self, tag_val: TagValue, f: F) where
F: FnOnce(&mut Self),
pub fn tag_build<F>(&mut self, tag_val: TagValue, f: F) where
F: FnOnce(&mut Self),
Append a Tagged value (TAG + CBOR value) in the writer
sourcepub fn constant(&mut self, d: Constant)
pub fn constant(&mut self, d: Constant)
Append a constant value (false, true, null, undefined) in the writer
Auto Trait Implementations
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnwindSafe for Writer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more