pub struct LuaMessageDescriptor(/* private fields */);

Methods from Deref<Target = MessageDescriptor>§

source

pub fn proto(&self) -> &DescriptorProto

Get underlying DescriptorProto object.

source

pub fn name(&self) -> &str

Message name as specified in .proto file.

source

pub fn nested_messages(&self) -> impl Iterator<Item = MessageDescriptor>

Messages declared in this messages.

source

pub fn nested_enums(&self) -> impl Iterator<Item = EnumDescriptor>

Get enums declared in this message.

source

pub fn enclosing_message(&self) -> Option<MessageDescriptor>

Get a message containing this message, or None if this message is declared at file level.

source

pub fn file_descriptor(&self) -> &FileDescriptor

FileDescriptor containing this message.

source

pub fn file_descriptor_proto(&self) -> &FileDescriptorProto

FileDescriptorProto containg this message type

source

pub fn is_map_entry(&self) -> bool

This message descriptor is a map entry.

source

pub fn new_instance(&self) -> Box<dyn MessageDyn>

New empty message.

Panics

If this message is a map entry message.

source

pub fn default_instance(&self) -> Option<&'static dyn MessageDyn>

Shared immutable empty message.

Returns None for dynamic message.

Panics

If this message is a map entry message.

source

pub fn eq( &self, a: &(dyn MessageDyn + 'static), b: &(dyn MessageDyn + 'static) ) -> bool

Check if two messages equal.

Panics

Is any message has different type than this descriptor.

source

pub fn full_name(&self) -> &str

Fully qualified protobuf message name

source

pub fn name_to_package(&self) -> &str

Name relative to the package where the message is declared.

source

pub fn all_oneofs<'a>(&'a self) -> impl Iterator<Item = OneofDescriptor> + 'a

Nested oneofs including synthetic.

source

pub fn oneofs<'a>(&'a self) -> impl Iterator<Item = OneofDescriptor> + 'a

Non-synthetic oneofs.

source

pub fn oneof_by_name(&self, name: &str) -> Option<OneofDescriptor>

Get message oneof by name (not implemented).

source

pub fn fields<'a>(&'a self) -> impl Iterator<Item = FieldDescriptor> + 'a

Message field descriptors.

source

pub fn extensions(&self) -> impl Iterator<Item = FieldDescriptor>

Extension fields.

source

pub fn field_by_name(&self, name: &str) -> Option<FieldDescriptor>

Find message field by protobuf field name

Note: protobuf field name might be different for Rust field name.

source

pub fn field_by_name_or_json_name<'a>( &'a self, name: &str ) -> Option<FieldDescriptor>

Find message field by field name or field JSON name

source

pub fn field_by_number(&self, number: u32) -> Option<FieldDescriptor>

Find message field by field name

source

pub fn parse_from( &self, is: &mut CodedInputStream<'_> ) -> Result<Box<dyn MessageDyn>, Error>

Parse message from stream.

source

pub fn parse_from_reader( &self, reader: &mut dyn Read ) -> Result<Box<dyn MessageDyn>, Error>

Parse message from reader. Parse stops on EOF or when error encountered.

source

pub fn parse_from_bytes( &self, bytes: &[u8] ) -> Result<Box<dyn MessageDyn>, Error>

Parse message from byte array.

Trait Implementations§

source§

impl Clone for LuaMessageDescriptor

source§

fn clone(&self) -> LuaMessageDescriptor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Deref for LuaMessageDescriptor

§

type Target = MessageDescriptor

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for LuaMessageDescriptor

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl From<MessageDescriptor> for LuaMessageDescriptor

source§

fn from(value: MessageDescriptor) -> Self

Converts to this type from the input type.
source§

impl Hash for LuaMessageDescriptor

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for LuaMessageDescriptor

source§

fn eq(&self, other: &LuaMessageDescriptor) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl UserData for LuaMessageDescriptor

source§

fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M)

Adds custom methods and operators specific to this userdata.
source§

fn add_fields<'lua, F>(fields: &mut F)where F: UserDataFields<'lua, Self>,

Adds custom fields specific to this userdata.
source§

impl Eq for LuaMessageDescriptor

source§

impl StructuralEq for LuaMessageDescriptor

source§

impl StructuralPartialEq for LuaMessageDescriptor

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<'lua, T> IntoLua<'lua> for Twhere T: UserData + MaybeSend + 'static,

source§

fn into_lua(self, lua: &'lua Lua) -> Result<Value<'lua>, Error>

Performs the conversion.
source§

impl<'lua, T> IntoLuaMulti<'lua> for Twhere T: IntoLua<'lua>,

source§

fn into_lua_multi(self, lua: &'lua Lua) -> Result<MultiValue<'lua>, Error>

Performs the conversion.
source§

unsafe fn push_into_stack_multi(self, lua: &'lua Lua) -> Result<i32, Error>

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.