In a modularized library you would replace your header with a cpp file, like so:
export module mylib;
auto foo() -> void {}
And then import that module from within your main compilation unit:
import mylib;
int main()
{
foo();
}
While you certainly can compile a header into a module unit, this is not the recommended approach. static inline is a compiler hack usually found in header-only libraries to guarantee ODR compliance. In modularized libraries you would not care about the name of the file where the function is defined, only the name of the containing module. You would also not mark the function as static as that would give it internal linkage, ie. not being a part of the module interface.
Modules allow us to develop and distribute libraries without any header files, which will lead to cleaner code and a safer compilation.
[Edit]
If you are unable to modify the header, e.g. if it's a system header or part of a library, you have the option of including the header in a module unit and provide wrappers around the functionality that you need:
module;
// Should include inside global module fragment
#include "Header.h"
// Export as a module unit
export module mylib;
// Declare wrapper
export namespace wrapper
{
auto Foo() -> void { return foo(); }
};
You do not actually need the namespace, but it might make for a cleaner interface.