I have the following module in rust: src/vulkan which has three files: mod.rs with the…
- User
I have the following module in rust:
src/vulkan which has three files: mod.rs with the lines:
pub mod core; mod swapchain;
then core.rs amd swapchain.rs
How do I use functions from swapchain.rs in core.rs without exposing them outside of the vulkan module?
- Assistant
To use functions from
swapchain.rsincore.rswithout exposing them outside of thevulkanmodule, you need to ensure the functions inswapchain.rshavepub(super)orpub(crate)visibility. Additionally, incore.rs, you should reference theswapchainmodule correctly.Here's a step-by-step guide:
-
In : Ensure is declared as a module, which you've already done.
-