Struct LuaMessageDescriptor

Source
pub struct LuaMessageDescriptor(pub MessageDescriptor);

Tuple Fields§

§0: MessageDescriptor

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

Source§

type Target = MessageDescriptor

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl From<LuaMessageDescriptor> for MessageDescriptor

Source§

fn from(value: LuaMessageDescriptor) -> Self

Converts to this type from the input type.
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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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<M: UserDataMethods<Self>>(methods: &mut M)

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

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

Adds custom fields specific to this userdata.
Source§

fn register(registry: &mut UserDataRegistry<Self>)

Registers this type for use in Lua. Read more
Source§

impl Eq for LuaMessageDescriptor

Source§

impl StructuralPartialEq for LuaMessageDescriptor

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

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

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where 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 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoLua for T
where T: UserData + MaybeSend + 'static,

Source§

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

Performs the conversion.
Source§

impl<T> IntoLuaMulti for T
where T: IntoLua,

Source§

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

Performs the conversion.
Source§

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 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.
Source§

impl<T> MaybeSend for T