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
impl LuaProtoc
pub fn new(descriptors: Vec<FileDescriptor>) -> Self
pub fn parse_files( inputs: impl IntoIterator<Item = impl AsRef<Path>>, includes: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Result<Self>
pub fn parse_proto(proto: impl AsRef<str>) -> Result<Self>
pub fn parse_pb(path: impl AsRef<Path>) -> Result<Self>
pub fn gen_pb(&self, path: String) -> Result<()>
pub fn gen_lua(&self, path: String) -> Result<()>
pub fn encode( &self, message_full_name: &str, lua_message: &Table, ) -> Result<Box<dyn MessageDyn>>
pub fn decode( &self, lua: &Lua, message_full_name: String, message_bytes: &[u8], ) -> Result<Table>
pub fn list_protos( paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Vec<PathBuf>
Trait Implementations§
Source§impl UserData for LuaProtoc
impl UserData for LuaProtoc
Source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
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>,
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>)
fn register(registry: &mut UserDataRegistry<Self>)
Registers this type for use in Lua. Read more
Auto Trait Implementations§
impl Freeze for LuaProtoc
impl !RefUnwindSafe for LuaProtoc
impl Send for LuaProtoc
impl Sync for LuaProtoc
impl Unpin for LuaProtoc
impl !UnwindSafe for LuaProtoc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
Source§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
Performs the conversion.