[−][src]Struct dusk_tlv::TlvWriter
Optionally consumes an implementation of io::Write
, and provides an adapter to convert
slices of bytes to TLV format, and output the result to the writer.
Methods
impl<W> TlvWriter<W> where
W: Write,
[src][−]
W: Write,
pub fn new(writer: W) -> Self
[src][−]
TlvWriter
constructor
pub fn into_inner(self) -> W
[src][−]
Consumes self, and return the inner writer
pub fn bytes_len_to_writer(writer: W, len: usize) -> Result<usize, Error>
[src][−]
Convert the provided slice of bytes to TLV format, and write the TL to the writer
pub fn bytes_to_writer(writer: W, buf: &[u8]) -> Result<usize, Error>
[src][−]
Convert the provided slice of bytes to TLV format, output the result to the provided writer, and return the amount of bytes written.
pub fn write_usize(&mut self, n: usize) -> Result<usize, Error>
[src][−]
Append the provided usize to the writer in TLV format
pub fn write_list<L: AsRef<[u8]>>(&mut self, list: &[L]) -> Result<usize, Error>
[src][−]
Write a list of serializable items
Trait Implementations
impl<W> Write for TlvWriter<W> where
W: Write,
[src][+]
W: Write,
impl<'a, W> SerializeTuple for &'a mut TlvWriter<W> where
W: Write,
[src][+]
W: Write,
impl<'a, W> Serializer for &'a mut TlvWriter<W> where
W: Write,
[src][+]
W: Write,
impl<'a, W> SerializeMap for &'a mut TlvWriter<W> where
W: Write,
[src][+]
W: Write,
impl<'a, '_, W> SerializeSeq for &'_ mut TlvWriter<W> where
W: Write,
[src][+]
W: Write,
impl<'a, W> SerializeStruct for &'a mut TlvWriter<W> where
W: Write,
[src][+]
W: Write,
impl<'a, W> SerializeStructVariant for &'a mut TlvWriter<W> where
W: Write,
[src][+]
W: Write,
impl<'a, W> SerializeTupleStruct for &'a mut TlvWriter<W> where
W: Write,
[src][+]
W: Write,
impl<'a, W> SerializeTupleVariant for &'a mut TlvWriter<W> where
W: Write,
[src][+]
W: Write,
Auto Trait Implementations
impl<W> Send for TlvWriter<W> where
W: Send,
W: Send,
impl<W> Sync for TlvWriter<W> where
W: Sync,
W: Sync,
impl<W> Unpin for TlvWriter<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for TlvWriter<W> where
W: UnwindSafe,
W: UnwindSafe,
impl<W> RefUnwindSafe for TlvWriter<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> From<T> for T
[src][+]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,