Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions juptuneEventLoopGetContext

1
2
3
4
5
6
7
module juptune.event.loop.async;

ContextT* juptuneEventLoopGetContext(
    ContextT
)(
    
);

Documentation

Accesses the current fibers's user context.

When you use the contextful asyncoverload it creates a user context in the fiber. This function is how you access the user context.

This function is type safe as it uses TypeInfoto enforce the user context is the type you expect it to be.

Currently I consider it a bug for there to be a mismatch, as it makes no sense to me to optionally support a user context, so this is enforced with an assert.

Throws

Asserts that ContextTis the same type that was passed into the asyncfunction.

Asserts that a user context exists for this fiber.

Returns

A pointer to the user context.