pub struct CodedOutputStream<'a> { /* private fields */ }
Expand description

Buffered write with handy utilities

Implementations

Construct from given Write.

CodedOutputStream is buffered even if Write is not

CodedOutputStream which writes directly to bytes.

Attempt to write more than bytes capacity results in error.

CodedOutputStream which writes directly to Vec<u8>.

Total number of bytes written to this stream.

This number may be larger than the actual number of bytes written to the underlying stream, if the buffer was not flushed.

The number may be inaccurate if there was an error during the write.

Check if EOF is reached.

Panics

If underlying write has no EOF

Flush to buffer to the underlying buffer. Note that CodedOutputStream does flush in the destructor, however, if flush in destructor fails, then destructor panics and program terminates. So it’s advisable to explicitly call flush before destructor.

Write a byte

Write bytes

Write a tag

Write varint

Write varint

Write 32-bit integer little endian

Write 64-bit integer little endian

Write float

Write double

Write float field

Write double field

Write varint

Write varint

Write varint

Write varint

Write zigzag varint

Write zigzag varint

Write fixed64

Write fixed32

Write sfixed64

Write sfixed32

Write bool

Write enum

Write enum

Write enum

Write unknown value

Write uint64 field

Write uint32 field

Write int64 field

Write int32 field

Write sint64 field

Write sint32 field

Write fixed64 field

Write fixed32 field

Write sfixed64 field

Write sfixed32 field

Write bool field

Write enum field

Write enum field

Write enum field

Write unknown field

Write unknown fields

Write bytes

Write string

Write message

Write dynamic message

Write bytes field

Write string field

Write repeated packed float values.

Write field header and data for repeated packed float.

Write repeated packed double values.

Write field header and data for repeated packed double.

Write repeated packed fixed32 values.

Write field header and data for repeated packed fixed32.

Write repeated packed fixed64 values.

Write field header and data for repeated packed fixed64.

Write repeated packed sfixed32 values.

Write field header and data for repeated packed sfixed32.

Write repeated packed sfixed64 values.

Write field header and data for repeated packed sfixed64.

Write repeated packed int32 values.

Write field header and data for repeated packed int32.

Write repeated packed int64 values.

Write field header and data for repeated packed int64.

Write repeated packed uint32 values.

Write field header and data for repeated packed uint32.

Write repeated packed uint64 values.

Write field header and data for repeated packed uint64.

Write repeated packed sint32 values.

Write field header and data for repeated packed sint32.

Write repeated packed sint64 values.

Write field header and data for repeated packed sint64.

Write repeated packed bool values.

Write field header and data for repeated packed bool.

Write repeated packed enum values.

Write field header and data for repeated packed enum.

Write message field

Write dynamic message field

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Write a buffer into this writer, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Like write, except that it writes from a slice of buffers. Read more

🔬 This is a nightly-only experimental API. (can_vector)

Determines if this Writer has an efficient write_vectored implementation. Read more

Attempts to write an entire buffer into this writer. Read more

🔬 This is a nightly-only experimental API. (write_all_vectored)

Attempts to write multiple buffers into this writer. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a “by reference” adapter for this instance of Write. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.