
Curtis P. answered 01/14/22
Video Game Design / Development Instructor | Unity | ROBLOX
Unfortunately I don't believe there is a way to do this easily.
A .mcfunction file is, simply put, a list of commands to run in the specified order.
For example a .mcfunction file named "GeneratePortal.mcfunction" might have something like this inside to generate a portal:
fill 10 52 -100 10 10 55 -100 obsidian
fill 13 52 -100 13 10 55 -100 obsidian
fill 11 52 -100 12 10 52 -100 obsidian
fill 11 55 -100 12 10 55 -100 obsidian
setblock 11 53 -100 fire
Whereas a structure file details all of the blocks, their properties, and all their nbt data. As well as all entities, their properties, and their nbt data. Which, depending on the structure, can be a lot of information to store for a function.
You may be able to find a converter somewhere that will read your structure file and write you a file with a list of setblocks necessary to make it. But creating something like that would definitely be a bit of a challenge.