Package

global.namespace.neuron.di

scala

Permalink

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
Visibility
  1. Public
  2. All

Type Members

  1. macro class Caching extends Annotation with StaticAnnotation

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

    Permalink
  3. type MethodBinding = PartialFunction[Method, Function0[_]]

    Permalink
  4. macro class Neuron extends Annotation with StaticAnnotation

    Permalink
    Annotations
    @compileTimeOnly( ... )
  5. type SynapseBinding = (Method) ⇒ Function0[_]

    Permalink

Value Members

  1. object CachingStrategy extends Serializable

    Permalink
  2. object Incubator

    Permalink
  3. def runtimeClassOf[A](implicit tag: ClassTag[A]): Class[A]

    Permalink
  4. macro def wire[A <: AnyRef]: A

    Permalink

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

    Breeds a neuron of the given type, wiring each synapse to a value with the same name and an assignment-compatible return type or to a function with the same name and an assignment-compatible return type which accepts the given type or any supertype 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 = wire[Foo[String]]
      println(foo.c)
    }

    When run, Main will print Hello, World! to standard output. When calling wire[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 5.0 (renamed from neuron, which was introduced in Neuron DI 4.2)

Inherited from AnyRef

Inherited from Any

Ungrouped