ProtobufMut

Trait ProtobufMut 

Source
pub trait ProtobufMut<'pool>: ProtobufRef<'pool> {
    // Required method
    fn as_object_mut(&mut self) -> &mut Object;

    // Provided methods
    fn decode_flat<const STACK_DEPTH: usize>(
        &mut self,
        arena: &mut Arena<'_>,
        buf: &[u8],
    ) -> bool { ... }
    fn decode<'a, E>(
        &mut self,
        arena: &mut Arena<'_>,
        provider: &'a mut impl FnMut() -> Result<Option<&'a [u8]>, E>,
    ) -> Result<(), Error<E>> { ... }
    fn async_decode<'a, E, F>(
        &'a mut self,
        arena: &mut Arena<'_>,
        provider: &'a mut impl FnMut() -> F,
    ) -> impl Future<Output = Result<(), Error<E>>>
       where F: Future<Output = Result<Option<&'a [u8]>, E>> + 'a { ... }
    fn decode_from_bufread<const STACK_DEPTH: usize>(
        &mut self,
        arena: &mut Arena<'_>,
        reader: &mut impl BufRead,
    ) -> Result<(), Error<Error>> { ... }
    fn decode_from_read<const STACK_DEPTH: usize>(
        &mut self,
        arena: &mut Arena<'_>,
        reader: &mut impl Read,
    ) -> Result<(), Error<Error>> { ... }
    fn decode_from_async_bufread<'a, const STACK_DEPTH: usize>(
        &'a mut self,
        arena: &'a mut Arena<'a>,
        reader: &mut (impl AsyncBufRead + Unpin),
    ) -> impl Future<Output = Result<(), Error<Error>>> { ... }
    fn decode_from_async_read<'a, const STACK_DEPTH: usize>(
        &'a mut self,
        arena: &'a mut Arena<'a>,
        reader: &mut (impl AsyncRead + Unpin),
    ) -> impl Future<Output = Result<(), Error<Error>>> { ... }
    fn serde_deserialize<'arena, 'alloc, 'de, D>(
        &'de mut self,
        arena: &'arena mut Arena<'alloc>,
        deserializer: D,
    ) -> Result<(), D::Error>
       where D: Deserializer<'de> { ... }
}
Expand description

Mutable protobuf operations (decode, deserialize). Extends ProtobufRef with mutation capabilities.

Required Methods§

Source

fn as_object_mut(&mut self) -> &mut Object

Provided Methods§

Source

fn decode_flat<const STACK_DEPTH: usize>( &mut self, arena: &mut Arena<'_>, buf: &[u8], ) -> bool

Source

fn decode<'a, E>( &mut self, arena: &mut Arena<'_>, provider: &'a mut impl FnMut() -> Result<Option<&'a [u8]>, E>, ) -> Result<(), Error<E>>

Source

fn async_decode<'a, E, F>( &'a mut self, arena: &mut Arena<'_>, provider: &'a mut impl FnMut() -> F, ) -> impl Future<Output = Result<(), Error<E>>>
where F: Future<Output = Result<Option<&'a [u8]>, E>> + 'a,

Source

fn decode_from_bufread<const STACK_DEPTH: usize>( &mut self, arena: &mut Arena<'_>, reader: &mut impl BufRead, ) -> Result<(), Error<Error>>

Source

fn decode_from_read<const STACK_DEPTH: usize>( &mut self, arena: &mut Arena<'_>, reader: &mut impl Read, ) -> Result<(), Error<Error>>

Source

fn decode_from_async_bufread<'a, const STACK_DEPTH: usize>( &'a mut self, arena: &'a mut Arena<'a>, reader: &mut (impl AsyncBufRead + Unpin), ) -> impl Future<Output = Result<(), Error<Error>>>

Source

fn decode_from_async_read<'a, const STACK_DEPTH: usize>( &'a mut self, arena: &'a mut Arena<'a>, reader: &mut (impl AsyncRead + Unpin), ) -> impl Future<Output = Result<(), Error<Error>>>

Source

fn serde_deserialize<'arena, 'alloc, 'de, D>( &'de mut self, arena: &'arena mut Arena<'alloc>, deserializer: D, ) -> Result<(), D::Error>
where D: Deserializer<'de>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'pool, 'msg> ProtobufMut<'pool> for DynamicMessage<'pool, 'msg>

Source§

impl<T: Protobuf> ProtobufMut<'static> for T