Package

com.avsystem.commons

meta

Permalink

package meta

Visibility
  1. Public
  2. All

Type Members

  1. trait AdtMetadataCompanion[M[_]] extends MetadataCompanion[M]

    Permalink
  2. trait BaseOptionLike[O, A] extends OptionLike[O]

    Permalink
  3. final class DefaultValue[T] extends AnyRef

    Permalink

    Captures case class parameter's default value.

    Captures case class parameter's default value. Used as type of ADT metadata parameter annotated with reifyDefaultValue.

  4. final case class Fallback[+T](value: T) extends AnyVal with Product with Serializable

    Permalink

    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
    }
  5. trait MacroInstances[Implicits, Instances] extends AnyRef

    Permalink

    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) or ADTs (e.g. RestDataCompanion). This all serves to reduce boilerplate associated with companion declarations and makes RPC trait or ADT definitions as concise as possible. It also lets the programmer easily inject additional implicits into macro-materialization of typeclasses aggregated by Instances trait.

    Instances is a trait that aggregates multiple macro materialized typeclass instances. There is no fixed interface for Instances, its abstract methods are inspected by MacroInstances.materialize macro and implemented automatically as <methodReturnTypeCompanion>.materialize Therefore, return type type of each method must have a companion object which contains materialize macro.

    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 you don't want to inject additional implicits, declare Implicits as Unit.

    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. Actual typeclass instances aggregated by Instances trait should be extracted into implicit lazy val definitions in the companion base class. See e.g. RestDataCompanion for an example of how it's done.

  6. final class Mapping[+V] extends commons.IMap[String, V] with MapLike[String, V, Mapping[V]]

    Permalink

    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. When caseInsensitive = true, fetching values by name will be case-insensitive, i.e. keys in internal hashmap and those passed to contains, isDefinedAt, apply and applyOrElse will be lowercased.

  7. trait MetadataCompanion[M[_]] extends AnyRef

    Permalink
  8. sealed trait OptionLike[O] extends AnyRef

    Permalink
  9. final case class ParamFlags(rawFlags: Int) extends AnyVal with Product with Serializable

    Permalink

    Information about real parameter flags and modifiers as defined in Scala code.

    Information about real parameter flags and modifiers as defined in Scala code.

    Annotations
    @transparent()
  10. final case class ParamPosition(index: Int, indexOfList: Int, indexInList: Int, indexInRaw: Int) extends Product with Serializable

    Permalink

    Information about real parameter position in its method.

    Information about real parameter position in its method. All indices start from 0.

    index

    overall index of the parameter, among all parameter lists

    indexOfList

    index of parameter list that this parameter belongs to

    indexInList

    index of the parameter inside its parameter list

    indexInRaw

    index of the parameter in its corresponding @multi metadata parameter (or zero if not @multi)

  11. final case class TypeFlags(rawFlags: Int) extends AnyVal with Product with Serializable

    Permalink

    Information about real parameter flags and modifiers as defined in Scala code.

    Information about real parameter flags and modifiers as defined in Scala code.

    Annotations
    @transparent()
  12. trait TypedMetadata[T] extends AnyRef

    Permalink

    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.

Ungrouped