antikythera v0.4.0 Antikythera.Context View Source
Definition of Antikythera.Context
struct which represents a context for an execution of gear code.
Note that gear_entry_point
is basically of type {module, atom}
, it is nil
during
(1) executor_pool_web_request/1
and (2) no_route/1
error handler.
Link to this section Summary
Functions
Type-aware getter for context_id.
Type-aware setter for context_id.
Type-aware getter for executor_pool_id.
Type-aware setter for executor_pool_id.
Type-aware getter for gear_entry_point.
Type-aware setter for gear_entry_point.
Type-aware getter for gear_name.
Type-aware setter for gear_name.
Creates a new instance of Antikythera.Context by using the given dict
.
A variant of new/1
which returns t
or raise if validation fails.
Type-aware getter for start_time.
Type-aware setter for start_time.
Updates an existing instance of Antikythera.Context with the given dict
.
The values in the dict
are validated by each field's valid?/1
function.
Returns {:ok, valid_struct}
or {:error, reason}
.
A variant of update/2
which returns t
or raise if validation fails.
In other words, update/2
followed by Croma.Result.get!/1
.
Checks if the given value belongs to t/0
or not.
Link to this section Types
Specs
t() :: %Antikythera.Context{ context_id: Antikythera.ContextId.t(), executor_pool_id: Croma.TypeGen.Nilable.Antikythera.ExecutorPool.Id.t(), gear_entry_point: Croma.TypeGen.Nilable.Antikythera.Context.GearEntryPoint.t(), gear_name: Antikythera.GearName.t(), start_time: Antikythera.Time.t() }
Link to this section Functions
Specs
context_id(t()) :: Antikythera.ContextId.t()
Type-aware getter for context_id.
Specs
context_id(t(), Antikythera.ContextId.t()) :: t()
Type-aware setter for context_id.
Specs
executor_pool_id(t()) :: Croma.TypeGen.Nilable.Antikythera.ExecutorPool.Id.t()
Type-aware getter for executor_pool_id.
Specs
Type-aware setter for executor_pool_id.
Specs
gear_entry_point(t()) :: Croma.TypeGen.Nilable.Antikythera.Context.GearEntryPoint.t()
Type-aware getter for gear_entry_point.
Specs
Type-aware setter for gear_entry_point.
Specs
gear_name(t()) :: Antikythera.GearName.t()
Type-aware getter for gear_name.
Specs
gear_name(t(), Antikythera.GearName.t()) :: t()
Type-aware setter for gear_name.
Specs
new(term()) :: Croma.Result.t(t())
Creates a new instance of Antikythera.Context by using the given dict
.
Returns {:ok, valid_struct}
or {:error, reason}
.
The values in the dict
are validated by each field's valid?/1
function.
If the value was invalid, it will be passed to new/1
of the field
For missing fields, followings will be tried:
default/0
of each field typenew/1
of each field type, with empty map as input
Specs
A variant of new/1
which returns t
or raise if validation fails.
In other words, new/1
followed by Croma.Result.get!/1
.
Specs
start_time(t()) :: Antikythera.Time.t()
Type-aware getter for start_time.
Specs
start_time(t(), Antikythera.Time.t()) :: t()
Type-aware setter for start_time.
Specs
update(t(), Dict.t()) :: Croma.Result.t(t())
Updates an existing instance of Antikythera.Context with the given dict
.
The values in the dict
are validated by each field's valid?/1
function.
Returns {:ok, valid_struct}
or {:error, reason}
.
Specs
A variant of update/2
which returns t
or raise if validation fails.
In other words, update/2
followed by Croma.Result.get!/1
.
Specs
Checks if the given value belongs to t/0
or not.