pub struct LuaProtoc {
    pub codec: LuaProtoCodec,
    pub file_descriptors: HashMap<String, LuaFileDescriptor>,
    pub message_descriptors: HashMap<String, LuaMessageDescriptor>,
    pub enum_descriptors: HashMap<String, LuaEnumDescriptor>,
}

Fields§

§codec: LuaProtoCodec§file_descriptors: HashMap<String, LuaFileDescriptor>§message_descriptors: HashMap<String, LuaMessageDescriptor>§enum_descriptors: HashMap<String, LuaEnumDescriptor>

Implementations§

source§

impl LuaProtoc

source

pub fn new(descriptors: Vec<FileDescriptor>) -> Self

source

pub fn parse_files( inputs: impl IntoIterator<Item = impl AsRef<Path>>, includes: impl IntoIterator<Item = impl AsRef<Path>> ) -> Result<Self>

source

pub fn parse_proto(proto: String) -> Result<Self>

source

pub fn parse_pb(path: impl AsRef<Path>) -> Result<Self>

source

pub fn gen_pb(&self, path: String) -> Result<()>

source

pub fn gen_lua(&self, path: String) -> Result<()>

source

pub fn encode( &self, message_full_name: String, lua_message: Table<'_> ) -> Result<Box<dyn MessageDyn>>

source

pub fn decode<'a>( &self, lua: &'a Lua, message_full_name: String, message_bytes: &[u8] ) -> Result<Table<'a>>

source

pub fn list_protos( paths: impl IntoIterator<Item = impl AsRef<Path>> ) -> Vec<PathBuf>

Trait Implementations§

source§

impl Default for LuaProtoc

source§

fn default() -> LuaProtoc

Returns the “default value” for a type. Read more
source§

impl UserData for LuaProtoc

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.

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<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, 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.