Struct wasmy_abi::types::CodedOutputStream
source · [−]pub struct CodedOutputStream<'a> { /* private fields */ }
Expand description
Buffered write with handy utilities
Implementations
sourceimpl<'a> CodedOutputStream<'a>
impl<'a> CodedOutputStream<'a>
sourcepub fn new(writer: &'a mut (dyn Write + 'a)) -> CodedOutputStream<'a>ⓘNotable traits for CodedOutputStream<'a>impl<'a> Write for CodedOutputStream<'a>
pub fn new(writer: &'a mut (dyn Write + 'a)) -> CodedOutputStream<'a>ⓘNotable traits for CodedOutputStream<'a>impl<'a> Write for CodedOutputStream<'a>
Construct from given Write
.
CodedOutputStream
is buffered even if Write
is not
sourcepub fn bytes(bytes: &'a mut [u8]) -> CodedOutputStream<'a>ⓘNotable traits for CodedOutputStream<'a>impl<'a> Write for CodedOutputStream<'a>
pub fn bytes(bytes: &'a mut [u8]) -> CodedOutputStream<'a>ⓘNotable traits for CodedOutputStream<'a>impl<'a> Write for CodedOutputStream<'a>
CodedOutputStream
which writes directly to bytes.
Attempt to write more than bytes capacity results in error.
sourcepub fn vec(vec: &'a mut Vec<u8, Global>) -> CodedOutputStream<'a>ⓘNotable traits for CodedOutputStream<'a>impl<'a> Write for CodedOutputStream<'a>
pub fn vec(vec: &'a mut Vec<u8, Global>) -> CodedOutputStream<'a>ⓘNotable traits for CodedOutputStream<'a>impl<'a> Write for CodedOutputStream<'a>
CodedOutputStream
which writes directly to Vec<u8>
.
Caller should call flush
at the end to guarantee vec contains
all written data.
sourcepub fn flush(&mut self) -> Result<(), ProtobufError>
pub fn flush(&mut self) -> Result<(), ProtobufError>
Flush the buffer to underlying write
sourcepub fn write_raw_byte(&mut self, byte: u8) -> Result<(), ProtobufError>
pub fn write_raw_byte(&mut self, byte: u8) -> Result<(), ProtobufError>
Write a byte
sourcepub fn write_raw_bytes(&mut self, bytes: &[u8]) -> Result<(), ProtobufError>
pub fn write_raw_bytes(&mut self, bytes: &[u8]) -> Result<(), ProtobufError>
Write bytes
sourcepub fn write_tag(
&mut self,
field_number: u32,
wire_type: WireType
) -> Result<(), ProtobufError>
pub fn write_tag(
&mut self,
field_number: u32,
wire_type: WireType
) -> Result<(), ProtobufError>
Write a tag
sourcepub fn write_raw_varint32(&mut self, value: u32) -> Result<(), ProtobufError>
pub fn write_raw_varint32(&mut self, value: u32) -> Result<(), ProtobufError>
Write varint
sourcepub fn write_raw_varint64(&mut self, value: u64) -> Result<(), ProtobufError>
pub fn write_raw_varint64(&mut self, value: u64) -> Result<(), ProtobufError>
Write varint
sourcepub fn write_raw_little_endian32(
&mut self,
value: u32
) -> Result<(), ProtobufError>
pub fn write_raw_little_endian32(
&mut self,
value: u32
) -> Result<(), ProtobufError>
Write 32-bit integer little endian
sourcepub fn write_raw_little_endian64(
&mut self,
value: u64
) -> Result<(), ProtobufError>
pub fn write_raw_little_endian64(
&mut self,
value: u64
) -> Result<(), ProtobufError>
Write 64-bit integer little endian
sourcepub fn write_float_no_tag(&mut self, value: f32) -> Result<(), ProtobufError>
pub fn write_float_no_tag(&mut self, value: f32) -> Result<(), ProtobufError>
Write float
sourcepub fn write_double_no_tag(&mut self, value: f64) -> Result<(), ProtobufError>
pub fn write_double_no_tag(&mut self, value: f64) -> Result<(), ProtobufError>
Write double
sourcepub fn write_float(
&mut self,
field_number: u32,
value: f32
) -> Result<(), ProtobufError>
pub fn write_float(
&mut self,
field_number: u32,
value: f32
) -> Result<(), ProtobufError>
Write float
field
sourcepub fn write_double(
&mut self,
field_number: u32,
value: f64
) -> Result<(), ProtobufError>
pub fn write_double(
&mut self,
field_number: u32,
value: f64
) -> Result<(), ProtobufError>
Write double
field
sourcepub fn write_uint64_no_tag(&mut self, value: u64) -> Result<(), ProtobufError>
pub fn write_uint64_no_tag(&mut self, value: u64) -> Result<(), ProtobufError>
Write varint
sourcepub fn write_uint32_no_tag(&mut self, value: u32) -> Result<(), ProtobufError>
pub fn write_uint32_no_tag(&mut self, value: u32) -> Result<(), ProtobufError>
Write varint
sourcepub fn write_int64_no_tag(&mut self, value: i64) -> Result<(), ProtobufError>
pub fn write_int64_no_tag(&mut self, value: i64) -> Result<(), ProtobufError>
Write varint
sourcepub fn write_int32_no_tag(&mut self, value: i32) -> Result<(), ProtobufError>
pub fn write_int32_no_tag(&mut self, value: i32) -> Result<(), ProtobufError>
Write varint
sourcepub fn write_sint64_no_tag(&mut self, value: i64) -> Result<(), ProtobufError>
pub fn write_sint64_no_tag(&mut self, value: i64) -> Result<(), ProtobufError>
Write zigzag varint
sourcepub fn write_sint32_no_tag(&mut self, value: i32) -> Result<(), ProtobufError>
pub fn write_sint32_no_tag(&mut self, value: i32) -> Result<(), ProtobufError>
Write zigzag varint
sourcepub fn write_fixed64_no_tag(&mut self, value: u64) -> Result<(), ProtobufError>
pub fn write_fixed64_no_tag(&mut self, value: u64) -> Result<(), ProtobufError>
Write fixed64
sourcepub fn write_fixed32_no_tag(&mut self, value: u32) -> Result<(), ProtobufError>
pub fn write_fixed32_no_tag(&mut self, value: u32) -> Result<(), ProtobufError>
Write fixed32
sourcepub fn write_sfixed64_no_tag(&mut self, value: i64) -> Result<(), ProtobufError>
pub fn write_sfixed64_no_tag(&mut self, value: i64) -> Result<(), ProtobufError>
Write sfixed64
sourcepub fn write_sfixed32_no_tag(&mut self, value: i32) -> Result<(), ProtobufError>
pub fn write_sfixed32_no_tag(&mut self, value: i32) -> Result<(), ProtobufError>
Write sfixed32
sourcepub fn write_bool_no_tag(&mut self, value: bool) -> Result<(), ProtobufError>
pub fn write_bool_no_tag(&mut self, value: bool) -> Result<(), ProtobufError>
Write bool
sourcepub fn write_enum_no_tag(&mut self, value: i32) -> Result<(), ProtobufError>
pub fn write_enum_no_tag(&mut self, value: i32) -> Result<(), ProtobufError>
Write enum
sourcepub fn write_enum_obj_no_tag<E>(
&mut self,
value: E
) -> Result<(), ProtobufError> where
E: ProtobufEnum,
pub fn write_enum_obj_no_tag<E>(
&mut self,
value: E
) -> Result<(), ProtobufError> where
E: ProtobufEnum,
Write enum
sourcepub fn write_unknown_no_tag(
&mut self,
unknown: UnknownValueRef<'_>
) -> Result<(), ProtobufError>
pub fn write_unknown_no_tag(
&mut self,
unknown: UnknownValueRef<'_>
) -> Result<(), ProtobufError>
Write unknown value
sourcepub fn write_uint64(
&mut self,
field_number: u32,
value: u64
) -> Result<(), ProtobufError>
pub fn write_uint64(
&mut self,
field_number: u32,
value: u64
) -> Result<(), ProtobufError>
Write uint64
field
sourcepub fn write_uint32(
&mut self,
field_number: u32,
value: u32
) -> Result<(), ProtobufError>
pub fn write_uint32(
&mut self,
field_number: u32,
value: u32
) -> Result<(), ProtobufError>
Write uint32
field
sourcepub fn write_int64(
&mut self,
field_number: u32,
value: i64
) -> Result<(), ProtobufError>
pub fn write_int64(
&mut self,
field_number: u32,
value: i64
) -> Result<(), ProtobufError>
Write int64
field
sourcepub fn write_int32(
&mut self,
field_number: u32,
value: i32
) -> Result<(), ProtobufError>
pub fn write_int32(
&mut self,
field_number: u32,
value: i32
) -> Result<(), ProtobufError>
Write int32
field
sourcepub fn write_sint64(
&mut self,
field_number: u32,
value: i64
) -> Result<(), ProtobufError>
pub fn write_sint64(
&mut self,
field_number: u32,
value: i64
) -> Result<(), ProtobufError>
Write sint64
field
sourcepub fn write_sint32(
&mut self,
field_number: u32,
value: i32
) -> Result<(), ProtobufError>
pub fn write_sint32(
&mut self,
field_number: u32,
value: i32
) -> Result<(), ProtobufError>
Write sint32
field
sourcepub fn write_fixed64(
&mut self,
field_number: u32,
value: u64
) -> Result<(), ProtobufError>
pub fn write_fixed64(
&mut self,
field_number: u32,
value: u64
) -> Result<(), ProtobufError>
Write fixed64
field
sourcepub fn write_fixed32(
&mut self,
field_number: u32,
value: u32
) -> Result<(), ProtobufError>
pub fn write_fixed32(
&mut self,
field_number: u32,
value: u32
) -> Result<(), ProtobufError>
Write fixed32
field
sourcepub fn write_sfixed64(
&mut self,
field_number: u32,
value: i64
) -> Result<(), ProtobufError>
pub fn write_sfixed64(
&mut self,
field_number: u32,
value: i64
) -> Result<(), ProtobufError>
Write sfixed64
field
sourcepub fn write_sfixed32(
&mut self,
field_number: u32,
value: i32
) -> Result<(), ProtobufError>
pub fn write_sfixed32(
&mut self,
field_number: u32,
value: i32
) -> Result<(), ProtobufError>
Write sfixed32
field
sourcepub fn write_bool(
&mut self,
field_number: u32,
value: bool
) -> Result<(), ProtobufError>
pub fn write_bool(
&mut self,
field_number: u32,
value: bool
) -> Result<(), ProtobufError>
Write bool
field
sourcepub fn write_enum(
&mut self,
field_number: u32,
value: i32
) -> Result<(), ProtobufError>
pub fn write_enum(
&mut self,
field_number: u32,
value: i32
) -> Result<(), ProtobufError>
Write enum
field
sourcepub fn write_enum_obj<E>(
&mut self,
field_number: u32,
value: E
) -> Result<(), ProtobufError> where
E: ProtobufEnum,
pub fn write_enum_obj<E>(
&mut self,
field_number: u32,
value: E
) -> Result<(), ProtobufError> where
E: ProtobufEnum,
Write enum
field
sourcepub fn write_unknown(
&mut self,
field_number: u32,
value: UnknownValueRef<'_>
) -> Result<(), ProtobufError>
pub fn write_unknown(
&mut self,
field_number: u32,
value: UnknownValueRef<'_>
) -> Result<(), ProtobufError>
Write unknown field
sourcepub fn write_unknown_fields(
&mut self,
fields: &UnknownFields
) -> Result<(), ProtobufError>
pub fn write_unknown_fields(
&mut self,
fields: &UnknownFields
) -> Result<(), ProtobufError>
Write unknown fields
sourcepub fn write_bytes_no_tag(&mut self, bytes: &[u8]) -> Result<(), ProtobufError>
pub fn write_bytes_no_tag(&mut self, bytes: &[u8]) -> Result<(), ProtobufError>
Write bytes
sourcepub fn write_string_no_tag(&mut self, s: &str) -> Result<(), ProtobufError>
pub fn write_string_no_tag(&mut self, s: &str) -> Result<(), ProtobufError>
Write string
sourcepub fn write_message_no_tag<M>(&mut self, msg: &M) -> Result<(), ProtobufError> where
M: Message,
pub fn write_message_no_tag<M>(&mut self, msg: &M) -> Result<(), ProtobufError> where
M: Message,
Write message
sourcepub fn write_bytes(
&mut self,
field_number: u32,
bytes: &[u8]
) -> Result<(), ProtobufError>
pub fn write_bytes(
&mut self,
field_number: u32,
bytes: &[u8]
) -> Result<(), ProtobufError>
Write bytes
field
sourcepub fn write_string(
&mut self,
field_number: u32,
s: &str
) -> Result<(), ProtobufError>
pub fn write_string(
&mut self,
field_number: u32,
s: &str
) -> Result<(), ProtobufError>
Write string
field
sourcepub fn write_message<M>(
&mut self,
field_number: u32,
msg: &M
) -> Result<(), ProtobufError> where
M: Message,
pub fn write_message<M>(
&mut self,
field_number: u32,
msg: &M
) -> Result<(), ProtobufError> where
M: Message,
Write message
field
Trait Implementations
sourceimpl<'a> Write for CodedOutputStream<'a>
impl<'a> Write for CodedOutputStream<'a>
sourcefn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for CodedOutputStream<'a>
impl<'a> !Send for CodedOutputStream<'a>
impl<'a> !Sync for CodedOutputStream<'a>
impl<'a> Unpin for CodedOutputStream<'a>
impl<'a> !UnwindSafe for CodedOutputStream<'a>
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more