Implementing a custom Sampler in Distributions.jl

I think the documentation is outdated. Most of the distributions in the package implement rand(rng::AbstractRNG, s::T) for their type T.

Try implementing only this:

function Base.rand(rng::AbstractRNG, d::ScaledShiftedBetaSampler)
    sample = rand(rng, d.distribution)
    return sample * (d.b - d.a) + d.a
end

I think the rest of the machinery you want will delegate to this method, including methods that use the global rng.