diff --git a/crates/lb/src/fs.rs b/crates/lb/src/fs.rs index ea4d7c5..43e9e0d 100644 --- a/crates/lb/src/fs.rs +++ b/crates/lb/src/fs.rs @@ -1,5 +1,7 @@ //! The `lb:fs` module provides utilities for interacting with the file system asynchronously. //! +//! # Exports +//! //! See [`lb_libfs`] for items exported by this module. use luaffi::{cdef, metatype}; use std::io; diff --git a/crates/lb/src/net.rs b/crates/lb/src/net.rs index ecdcb30..e159e52 100644 --- a/crates/lb/src/net.rs +++ b/crates/lb/src/net.rs @@ -1,6 +1,8 @@ //! The `lb:net` module provides an asynchronous network API for creating TCP or UDP servers and //! clients. //! +//! # Exports +//! //! See [`lb_libnet`] for items exported by this module. use derive_more::{From, FromStr}; use luaffi::{cdef, metatype}; @@ -117,8 +119,8 @@ impl lb_libnet { /// # Errors /// /// Throws if an error was encountered during the socket creation. - pub extern "Lua" fn tcp_v4(&self) -> lb_tcpsocket { - self.__new_tcp_v4() + pub extern "Lua-C" fn tcp_v4(&self) -> io::Result { + TcpSocket::new_v4().map(lb_tcpsocket) } /// Creates a new TCP socket configured for IPv6. @@ -128,15 +130,7 @@ impl lb_libnet { /// # Errors /// /// Throws if an error was encountered during the socket creation. - pub extern "Lua" fn tcp_v6(&self) -> lb_tcpsocket { - self.__new_tcp_v6() - } - - extern "Lua-C" fn __new_tcp_v4(&self) -> io::Result { - TcpSocket::new_v4().map(lb_tcpsocket) - } - - extern "Lua-C" fn __new_tcp_v6(&self) -> io::Result { + pub extern "Lua-C" fn tcp_v6(&self) -> io::Result { TcpSocket::new_v6().map(lb_tcpsocket) } }