pub struct BytesCodec;Expand description
Codec for the bytes proto type.
Trait Implementations§
Source§impl ExtensionCodec for BytesCodec
impl ExtensionCodec for BytesCodec
Source§fn decode(number: u32, fields: &UnknownFields) -> Option<Vec<u8>>
fn decode(number: u32, fields: &UnknownFields) -> Option<Vec<u8>>
Decode this extension’s value from the extendee’s unknown fields.
Source§fn try_encode(
number: u32,
value: Vec<u8>,
fields: &mut UnknownFields,
) -> Result<(), EncodeError>
fn try_encode( number: u32, value: Vec<u8>, fields: &mut UnknownFields, ) -> Result<(), EncodeError>
Encode
value into the extendee’s unknown fields. Read moreSource§fn encode(number: u32, value: Self::Value, fields: &mut UnknownFields)
fn encode(number: u32, value: Self::Value, fields: &mut UnknownFields)
Panicking wrapper over
try_encode. Read moreSource§impl SingularCodec for BytesCodec
impl SingularCodec for BytesCodec
type Value = Vec<u8>
Source§fn decode_one(data: &UnknownFieldData) -> Option<Vec<u8>>
fn decode_one(data: &UnknownFieldData) -> Option<Vec<u8>>
Decode one value from one unknown-field record’s data. Read more
Source§fn decode_packed(_bytes: &[u8], _out: &mut Vec<Vec<u8>>)
fn decode_packed(_bytes: &[u8], _out: &mut Vec<Vec<u8>>)
Decode all values from a packed
LengthDelimited payload. Read moreSource§fn try_encode_one(value: &Vec<u8>) -> Result<UnknownFieldData, EncodeError>
fn try_encode_one(value: &Vec<u8>) -> Result<UnknownFieldData, EncodeError>
Encode one value as a single unknown-field record. Read more
Source§fn decode_one_ctx(
data: &UnknownFieldData,
_ctx: DecodeContext<'_>,
) -> Option<Self::Value>
fn decode_one_ctx( data: &UnknownFieldData, _ctx: DecodeContext<'_>, ) -> Option<Self::Value>
Decode one value under a decode context shared with the other
records of the same field. Read more
Source§fn encode_one(value: &Self::Value) -> UnknownFieldData
fn encode_one(value: &Self::Value) -> UnknownFieldData
Panicking wrapper over
try_encode_one. Read moreAuto Trait Implementations§
impl Forget for BytesCodec
impl Freeze for BytesCodec
impl Move for BytesCodec
impl RefUnwindSafe for BytesCodec
impl Send for BytesCodec
impl Sync for BytesCodec
impl Unpin for BytesCodec
impl UnsafeUnpin for BytesCodec
impl UnwindSafe for BytesCodec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more