Captures case class parameter's default value.
Wrap your implicit instance of AsReal
, AsRaw
, AsRawReal
or RPC metadata (with companion that extends
RpcMetadataCompanion
) into Fallback in order to lower its implicit priority.
Useful when some implicit must be imported but we don't want it to get higher priority that imports normally
have over implicit scope (e.g. implicits from companion objects).
Wrap your implicit instance of AsReal
, AsRaw
, AsRawReal
or RPC metadata (with companion that extends
RpcMetadataCompanion
) into Fallback in order to lower its implicit priority.
Useful when some implicit must be imported but we don't want it to get higher priority that imports normally
have over implicit scope (e.g. implicits from companion objects).
NOTE: Fallback
does not work for *all* typeclasses, only RPC-related ones (AsReal
, AsRaw
, etc).
You can make it work with your own typeclass, but you must define appropriate forwarder in its companion, e.g.
trait FallbackAwareTC[T] { ... } object FallbackAwareTC { implicit def fromFallback[T](implicit f: Fallback[FallbackAwareTC[T]]): FallbackAwareTC[T] = f.value }
Intermediate factory that creates an Instances
trait based on provided Implicits
.
Intermediate factory that creates an Instances
trait based on provided Implicits
.
Normally, this factory is used as implicit constructor parameter of base classes for companion objects
of RPC traits (e.g. DefaultRestApiCompanion).
This all serves to reduce boilerplate associated with RPC trait companion declarations and makes RPC trait
definitions as concise as possible. It also lets the programmer easily inject additional implicits into
macro-materialization of RPC-related typeclasses (AsReal
, AsRaw
, metadata, etc.).
Instances
is a trait that aggregates multiple macro materialized typeclass instances.
There is no fixed interface for Instances
, its members are inspected by materialize
macro and implemented
automatically. Instances
must contain only parameterless abstract methods. Return type of each method
must have a companion object which contains materialize
macro. That macro will be used to implement
that method.
Example of Instances
: ClientInstances
The Implicits
type is typically a trait with a collection of implicit definitions whose companion object
implements that trait, e.g. DefaultRestImplicits.
When the macro implements apply
method of MacroInstances
contents of Implicits
are imported into the
body of apply
and visible further by macros that materialize InstancesTrait
.
If MacroInstances
is accepted as implicit super constructor parameter of a companion object
(which is the typical situation) then this
reference should be passed as companion
.
This is in order to work around https://github.com/scala/bug/issues/7666
Simple immutable structure to collect named values while retaining their order and providing fast, hashed lookup by name when necessary.
Simple immutable structure to collect named values while retaining their order and providing fast, hashed lookup by name when necessary. Intended to be used for multi raw parameters.
Information about real parameter flags and modifiers as defined in Scala code.
Information about real parameter flags and modifiers as defined in Scala code.
Information about real parameter position in its method.
Information about real parameter position in its method. All indices start from 0.
overall index of the parameter, among all parameter lists
index of parameter list that this parameter belongs to
index of the parameter inside its parameter list
index of the parameter in its corresponding @multi
metadata parameter
(or zero if not @multi
)
Information about real parameter flags and modifiers as defined in Scala code.
Information about real parameter flags and modifiers as defined in Scala code.
This trait must be extended by all method metadata classes and all parameter metadata classes.
This trait must be extended by all method metadata classes and all parameter metadata classes.
For method metadata, type parameter T
will be matched against each real method result type.
For parameter metadata, type parameter T
will be matched against each real parameter type.
Captures case class parameter's default value. Used as type of ADT metadata parameter annotated with reifyDefaultValue.