Skip to main content

MutProtoObject

Trait MutProtoObject 

Source
pub trait MutProtoObject:
    SealedInternal
    + ProtoObject
    + AsMut<MutProxied = Self>
    + 'static {
    type Mut<'msg>: AsMut<MutProxied = Self> + IntoMut<'msg> + IntoView<'msg>;
}
Expand description

NOTE: This type is primarily an implementation detail in support of trait resolution, and application code should very rarely write this type.

A ProtoObject that can also be accessed mutably through a reference-like proxy.

An instance of a MutProtoObject can be accessed mutably via MutProtoObject::Mut and immutably via ProtoObject::View.

MutProtoObject is implemented by message, map and repeated field types.

Required Associated Types§

Source

type Mut<'msg>: AsMut<MutProxied = Self> + IntoMut<'msg> + IntoView<'msg>

The proxy type that provides exclusive mutable access to a T, like a &'msg mut T.

Most code should use the type alias Mut.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K: MapKey, V: MapValue> MutProtoObject for Map<K, V>

Source§

type Mut<'msg> = MapMut<'msg, K, V>

Source§

impl<T: Singular> MutProtoObject for Repeated<T>

Source§

type Mut<'msg> = RepeatedMut<'msg, T>
where Repeated<T>: 'msg,