Internals

ContextVariablesX.genkeyMethod
genkey(__module__::Module, varname::Symbol) -> Union{UUID,Nothing}.

Generate a stable UUID for a context variable __module__.$varname.

source
ContextVariablesX.merge_ctxvarsMethod
merge_ctxvars(ctx::Union{Nothing,T}, kvs) -> ctx′:: Union{Nothing,T}
Warning

This is not a public API. This documentation is for making it easier to experiment with different implementations of the context variable storage backend, by monkey-patching it at run-time. When this function is monkey-patched, ctxvars_type should also be monkey-patched to return the type T.

The first argument ctx is either nothing or a dict-like object of type T where its keytype is UUID and valtype is Any. The second argument kvs is an iterable of Pair{UUID,<:Union{Some,Nothing}} values. Iterable kvs must have length.

If ctx is nothing and kvs is non-empty, merge_ctxvars creates a new instance of T. If ctx is not nothing, it returns a shallow-copy ctx′ of ctx where k => v is inserted to ctx′ for each k => Some(v) in kvs and k is deleted from ctx′ for each k => nothing in kvs.

source