Skip to main content

ExtensionId

Struct ExtensionId 

Source
pub struct ExtensionId<Extendee, T: Proxied> { /* private fields */ }
Expand description

A unique identifier for an extension field. Values of this type are emitted into the generated code and used to access extension fields.

The type parameter Extendee is the message type that the extension field is extending.

The type parameter T defines the kind of extension field: either T for a singular extension or Repeated<T> for a repeated extension.

Implementations§

Source§

impl<Extendee, T: Proxied> ExtensionId<Extendee, T>

Source

pub const fn number(&self) -> u32

Source§

impl<Extendee: Message, T: Proxied + EntityType> ExtensionId<Extendee, T>

Source

pub fn has(&self, msg: impl AsView<Proxied = Extendee>) -> bool
where Self: ExtHas<Extendee>,

Source

pub fn get<'msg>( &self, msg: impl IntoView<'msg, Proxied = Extendee>, ) -> View<'msg, T>
where Self: ExtAccess<Extendee, T, <T as EntityType>::Tag>,

Source

pub fn clear(&self, msg: impl AsMut<MutProxied = Extendee>)
where Self: ExtClear<Extendee>,

Source

pub fn set( &self, msg: impl AsMut<MutProxied = Extendee>, value: impl IntoProxied<T>, )
where Self: ExtAccess<Extendee, T, <T as EntityType>::Tag>,

Source

pub fn get_mut<'msg>( &self, msg: impl IntoMut<'msg, MutProxied = Extendee>, ) -> Mut<'msg, T>
where T: MutProxied, Self: ExtGetMut<Extendee, T, <T as EntityType>::Tag>,

Auto Trait Implementations§

§

impl<Extendee, T> Forget for ExtensionId<Extendee, T>

§

impl<Extendee, T> Freeze for ExtensionId<Extendee, T>
where Option<<T as ProtoObject>::View<'static>>: Freeze, PhantomData<Extendee>: Freeze,

§

impl<Extendee, T> Move for ExtensionId<Extendee, T>

§

impl<Extendee, T> RefUnwindSafe for ExtensionId<Extendee, T>
where Option<<T as ProtoObject>::View<'static>>: RefUnwindSafe, PhantomData<Extendee>: RefUnwindSafe,

§

impl<Extendee, T> Send for ExtensionId<Extendee, T>
where Option<<T as ProtoObject>::View<'static>>: Send, PhantomData<Extendee>: Send,

§

impl<Extendee, T> Sync for ExtensionId<Extendee, T>
where Option<<T as ProtoObject>::View<'static>>: Sync, PhantomData<Extendee>: Sync,

§

impl<Extendee, T> Unpin for ExtensionId<Extendee, T>
where Option<<T as ProtoObject>::View<'static>>: Unpin, PhantomData<Extendee>: Unpin,

§

impl<Extendee, T> UnsafeUnpin for ExtensionId<Extendee, T>
where Option<<T as ProtoObject>::View<'static>>: UnsafeUnpin, PhantomData<Extendee>: UnsafeUnpin,

§

impl<Extendee, T> UnwindSafe for ExtensionId<Extendee, T>
where Option<<T as ProtoObject>::View<'static>>: UnwindSafe, PhantomData<Extendee>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.