Add exports header to module docs

This commit is contained in:
lumi 2025-06-25 18:42:29 +10:00
parent 98100d02fa
commit 6cdf186b61
Signed by: luaneko
GPG Key ID: 406809B8763FF07A
2 changed files with 7 additions and 11 deletions

View File

@ -1,5 +1,7 @@
//! The `lb:fs` module provides utilities for interacting with the file system asynchronously. //! The `lb:fs` module provides utilities for interacting with the file system asynchronously.
//! //!
//! # Exports
//!
//! See [`lb_libfs`] for items exported by this module. //! See [`lb_libfs`] for items exported by this module.
use luaffi::{cdef, metatype}; use luaffi::{cdef, metatype};
use std::io; use std::io;

View File

@ -1,6 +1,8 @@
//! The `lb:net` module provides an asynchronous network API for creating TCP or UDP servers and //! The `lb:net` module provides an asynchronous network API for creating TCP or UDP servers and
//! clients. //! clients.
//! //!
//! # Exports
//!
//! See [`lb_libnet`] for items exported by this module. //! See [`lb_libnet`] for items exported by this module.
use derive_more::{From, FromStr}; use derive_more::{From, FromStr};
use luaffi::{cdef, metatype}; use luaffi::{cdef, metatype};
@ -117,8 +119,8 @@ impl lb_libnet {
/// # Errors /// # Errors
/// ///
/// Throws if an error was encountered during the socket creation. /// Throws if an error was encountered during the socket creation.
pub extern "Lua" fn tcp_v4(&self) -> lb_tcpsocket { pub extern "Lua-C" fn tcp_v4(&self) -> io::Result<lb_tcpsocket> {
self.__new_tcp_v4() TcpSocket::new_v4().map(lb_tcpsocket)
} }
/// Creates a new TCP socket configured for IPv6. /// Creates a new TCP socket configured for IPv6.
@ -128,15 +130,7 @@ impl lb_libnet {
/// # Errors /// # Errors
/// ///
/// Throws if an error was encountered during the socket creation. /// Throws if an error was encountered during the socket creation.
pub extern "Lua" fn tcp_v6(&self) -> lb_tcpsocket { pub extern "Lua-C" fn tcp_v6(&self) -> io::Result<lb_tcpsocket> {
self.__new_tcp_v6()
}
extern "Lua-C" fn __new_tcp_v4(&self) -> io::Result<lb_tcpsocket> {
TcpSocket::new_v4().map(lb_tcpsocket)
}
extern "Lua-C" fn __new_tcp_v6(&self) -> io::Result<lb_tcpsocket> {
TcpSocket::new_v6().map(lb_tcpsocket) TcpSocket::new_v6().map(lb_tcpsocket)
} }
} }