[][src]Struct protobuf::CodedOutputStream

pub struct CodedOutputStream<'a> { /* fields omitted */ }

Buffered write with handy utilities

Methods

impl<'a> CodedOutputStream<'a>[src]

Important traits for CodedOutputStream<'a>
pub fn new(writer: &'a mut dyn Write) -> CodedOutputStream<'a>[src]

Construct from given Write.

CodedOutputStream is buffered even if Write is not

Important traits for CodedOutputStream<'a>
pub fn bytes(bytes: &'a mut [u8]) -> CodedOutputStream<'a>[src]

CodedOutputStream which writes directly to bytes.

Attempt to write more than bytes capacity results in error.

Important traits for CodedOutputStream<'a>
pub fn vec(vec: &'a mut Vec<u8>) -> CodedOutputStream<'a>[src]

CodedOutputStream which writes directly to Vec<u8>.

Caller should call flush at the end to guarantee vec contains all written data.

pub fn check_eof(&self)[src]

Check if EOF is reached.

Panics

If underlying write has no EOF

pub fn flush(&mut self) -> ProtobufResult<()>[src]

Flush the buffer to underlying write

pub fn write_raw_byte(&mut self, byte: u8) -> ProtobufResult<()>[src]

Write a byte

pub fn write_raw_bytes(&mut self, bytes: &[u8]) -> ProtobufResult<()>[src]

Write bytes

pub fn write_tag(
    &mut self,
    field_number: u32,
    wire_type: WireType
) -> ProtobufResult<()>
[src]

Write a tag

pub fn write_raw_varint32(&mut self, value: u32) -> ProtobufResult<()>[src]

Write varint

pub fn write_raw_varint64(&mut self, value: u64) -> ProtobufResult<()>[src]

Write varint

pub fn write_raw_little_endian32(&mut self, value: u32) -> ProtobufResult<()>[src]

Write 32-bit integer little endian

pub fn write_raw_little_endian64(&mut self, value: u64) -> ProtobufResult<()>[src]

Write 64-bit integer little endian

pub fn write_float_no_tag(&mut self, value: f32) -> ProtobufResult<()>[src]

Write float

pub fn write_double_no_tag(&mut self, value: f64) -> ProtobufResult<()>[src]

Write double

pub fn write_float(
    &mut self,
    field_number: u32,
    value: f32
) -> ProtobufResult<()>
[src]

Write float field

pub fn write_double(
    &mut self,
    field_number: u32,
    value: f64
) -> ProtobufResult<()>
[src]

Write double field

pub fn write_uint64_no_tag(&mut self, value: u64) -> ProtobufResult<()>[src]

Write varint

pub fn write_uint32_no_tag(&mut self, value: u32) -> ProtobufResult<()>[src]

Write varint

pub fn write_int64_no_tag(&mut self, value: i64) -> ProtobufResult<()>[src]

Write varint

pub fn write_int32_no_tag(&mut self, value: i32) -> ProtobufResult<()>[src]

Write varint

pub fn write_sint64_no_tag(&mut self, value: i64) -> ProtobufResult<()>[src]

Write zigzag varint

pub fn write_sint32_no_tag(&mut self, value: i32) -> ProtobufResult<()>[src]

Write zigzag varint

pub fn write_fixed64_no_tag(&mut self, value: u64) -> ProtobufResult<()>[src]

Write fixed64

pub fn write_fixed32_no_tag(&mut self, value: u32) -> ProtobufResult<()>[src]

Write fixed32

pub fn write_sfixed64_no_tag(&mut self, value: i64) -> ProtobufResult<()>[src]

Write sfixed64

pub fn write_sfixed32_no_tag(&mut self, value: i32) -> ProtobufResult<()>[src]

Write sfixed32

pub fn write_bool_no_tag(&mut self, value: bool) -> ProtobufResult<()>[src]

Write bool

pub fn write_enum_no_tag(&mut self, value: i32) -> ProtobufResult<()>[src]

Write enum

pub fn write_enum_obj_no_tag<E>(&mut self, value: E) -> ProtobufResult<()> where
    E: ProtobufEnum
[src]

Write enum

pub fn write_unknown_no_tag(
    &mut self,
    unknown: UnknownValueRef
) -> ProtobufResult<()>
[src]

Write unknown value

pub fn write_uint64(
    &mut self,
    field_number: u32,
    value: u64
) -> ProtobufResult<()>
[src]

Write uint64 field

pub fn write_uint32(
    &mut self,
    field_number: u32,
    value: u32
) -> ProtobufResult<()>
[src]

Write uint32 field

pub fn write_int64(
    &mut self,
    field_number: u32,
    value: i64
) -> ProtobufResult<()>
[src]

Write int64 field

pub fn write_int32(
    &mut self,
    field_number: u32,
    value: i32
) -> ProtobufResult<()>
[src]

Write int32 field

pub fn write_sint64(
    &mut self,
    field_number: u32,
    value: i64
) -> ProtobufResult<()>
[src]

Write sint64 field

pub fn write_sint32(
    &mut self,
    field_number: u32,
    value: i32
) -> ProtobufResult<()>
[src]

Write sint32 field

pub fn write_fixed64(
    &mut self,
    field_number: u32,
    value: u64
) -> ProtobufResult<()>
[src]

Write fixed64 field

pub fn write_fixed32(
    &mut self,
    field_number: u32,
    value: u32
) -> ProtobufResult<()>
[src]

Write fixed32 field

pub fn write_sfixed64(
    &mut self,
    field_number: u32,
    value: i64
) -> ProtobufResult<()>
[src]

Write sfixed64 field

pub fn write_sfixed32(
    &mut self,
    field_number: u32,
    value: i32
) -> ProtobufResult<()>
[src]

Write sfixed32 field

pub fn write_bool(
    &mut self,
    field_number: u32,
    value: bool
) -> ProtobufResult<()>
[src]

Write bool field

pub fn write_enum(
    &mut self,
    field_number: u32,
    value: i32
) -> ProtobufResult<()>
[src]

Write enum field

pub fn write_enum_obj<E>(
    &mut self,
    field_number: u32,
    value: E
) -> ProtobufResult<()> where
    E: ProtobufEnum
[src]

Write enum field

pub fn write_unknown(
    &mut self,
    field_number: u32,
    value: UnknownValueRef
) -> ProtobufResult<()>
[src]

Write unknown field

pub fn write_unknown_fields(
    &mut self,
    fields: &UnknownFields
) -> ProtobufResult<()>
[src]

Write unknown fields

pub fn write_bytes_no_tag(&mut self, bytes: &[u8]) -> ProtobufResult<()>[src]

Write bytes

pub fn write_string_no_tag(&mut self, s: &str) -> ProtobufResult<()>[src]

Write string

pub fn write_message_no_tag<M: Message>(
    &mut self,
    msg: &M
) -> ProtobufResult<()>
[src]

Write message

pub fn write_bytes(
    &mut self,
    field_number: u32,
    bytes: &[u8]
) -> ProtobufResult<()>
[src]

Write bytes field

pub fn write_string(&mut self, field_number: u32, s: &str) -> ProtobufResult<()>[src]

Write string field

pub fn write_message<M: Message>(
    &mut self,
    field_number: u32,
    msg: &M
) -> ProtobufResult<()>
[src]

Write message field

Trait Implementations

impl<'a> Write for CodedOutputStream<'a>[src]

fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>1.36.0[src]

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

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>1.0.0[src]

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

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>1.0.0[src]

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

fn by_ref(&mut self) -> &mut Self1.0.0[src]

Creates a "by reference" adaptor for this instance of Write. Read more

Auto Trait Implementations

impl<'a> !Send for CodedOutputStream<'a>

impl<'a> !Sync for CodedOutputStream<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]