User defined functions in a module

Howdy, folks.
I have a code which allows for a user defined function. I do this with a struct:

Base.@kwdef mutable struct Solver{T<:Function}
    Δt :: Float64 = 0.3
    t :: Float64 = 0.0
    ...
    kinematicVelocity :: T = (_...) -> SA_F64[0,0,0]
end

So the user can create an arbitrary function and put it in that struct, which is used throughout the code and is its main input.
This works ok, but I don’t love it as a solution. It’s ok when I’m using the CPU version of my code, but for the GPU I don’t really know how to pass an arbitrary function within a struct do it.
I need to make another one of these user defined functions and I’m wondering about the best way to do it (this function needs to work on the GPU, unlike that other function). One option I thought of was to pass it as a string within that struct and eval it in my code.
The other option I can think of is to let the user simply declare that function before calling my code, overriding my default one. Not sure there are some caveats to doing that.

Has anyone else run into this before? Any clever solutions that I haven’t thought of?
Thanks a lot!

Yes, it’s not very idiomatic to have a function as part of a struct.
You could have

abstract type SolverAlgorithm end

struct DefaultSolverAlgorithm :< SolverAlgorithm
     Δt :: Float64
       t :: Float64 
     ...
end
function solve(args....,solver::SolverAlgorithm)
    error("Solve not implemented for this solverAlgorithm!")
end
function solve(args....,solver::DefaultSolverAlgorithm=DefaultSolverAlgorithm(Δt=0.3,t=0.0,...)
  ...
end

At that point one that want to create a custom solver just need to create a struct child of SolverAlgorithm and provide its own implementation of solve.
This is the way I did implement train and singleUpdate! in a deep learning lib.