global.namespace.neuron.di

scala

package scala

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. scala
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class Caching extends Annotation with StaticAnnotation

    Annotations
    @compileTimeOnly( ... )
  2. type CachingStrategy = java.CachingStrategy

  3. class Neuron extends Annotation with StaticAnnotation

    Annotations
    @compileTimeOnly( ... )

Value Members

  1. object CachingStrategy extends Serializable

  2. object Incubator

  3. macro def neuron[A <: AnyRef]: A

    Breeds a neuron of the given type, wiring each synapse to a value with the same name and return type or to a function with the same name and return type which accepts the given type as its sole parameter.

    Breeds a neuron of the given type, wiring each synapse to a value with the same name and return type or to a function with the same name and return type which accepts the given type as its sole parameter. Example:

    @Neuron
    trait Foo[A] {
      def a: A
      def b: A
      def c: A
    }
    
    object Main extends App {
      val a = "World"
      def b(neuron: Foo[String]) = "Hello, " + neuron.a
      val c = (neuron: Foo[String]) => neuron.b + "!"
      val foo = neuron[Foo[String]]
      println(foo.c)
    }

    When run, Main will print Hello, World! to standard output. When calling neuron[Foo[String]], the type parameter of Foo is set to String, so the synapses a, b and c each return a String. The synapses are bound to their dependencies as follows: + The synapse a is bound to the value a of type String. + The synapse b is bound to the function definition b which accepts a parameter of the type Foo[String]. + The synapse c is bound to the function value c which again accepts a parameter of the type Foo[String].

    Finally, when calling foo.c, the function value c will call the function definition b which in turn will call the value a to compute "Hello, World!".

    Since

    Neuron DI 4.2

Inherited from AnyRef

Inherited from Any

Ungrouped