object MacroOptions
MacroOptions factories & utilities.
- Alphabetic
- By Inheritance
- MacroOptions
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait AutomaticMaterialization extends Default
For a sealed family (all implementations of a sealed trait or defined explicit union types), this option enables the automatic materialization of handlers for the member types.
For a sealed family (all implementations of a sealed trait or defined explicit union types), this option enables the automatic materialization of handlers for the member types.
If used, make sure it cannot lead to type recursion issue (reason why it's not disabled by default).
import reactivemongo.api.bson.{ BSONDocumentReader, Macros, MacroOptions } sealed trait Family case class TypeA(n: Int) extends Family case class TypeB(s: String) extends Family case class TypeC(f: Float) extends Family val reader: BSONDocumentReader[Family] = Macros.using[MacroOptions.AutomaticMaterialization].reader[Family] // Automatically/internally materializes the readers for Type{A,B,C}
- trait Default extends MacroOptions
The default options that are implied if invoking "non-Opts" method.
The default options that are implied if invoking "non-Opts" method. All other options extend this.
- trait DisableWarnings extends Default
The options to disable compilation warnings.
- trait LowPriorityValueOfImplicits extends AnyRef
- trait UnionType[Types <: \/[_, _]] extends Default
This allows to restrict the handling of family to only some subtypes (not required to be sealed in this case).
This allows to restrict the handling of family to only some subtypes (not required to be sealed in this case).
import reactivemongo.api.bson.{ BSONDocumentWriter, Macros, MacroOptions }, MacroOptions.\/ trait Family case class TypeA(n: Int) extends Family case class TypeB(s: String) extends Family case class TypeC(f: Float) extends Family val writer: BSONDocumentWriter[Family] = { implicit val a = Macros.writer[TypeA] implicit val b = Macros.writer[TypeB] Macros.using[MacroOptions.UnionType[TypeA \/ TypeB]].writer[Family] }
- Types
to restrict the subtypes to handle
- See also
\/
- trait ValueOf[O <: MacroOptions] extends AnyRef
- trait Verbose extends Default
The options to print out generated code during compilation.
The options to print out generated code during compilation.
import reactivemongo.api.bson.{ BSONDocumentWriter, Macros, MacroOptions } case class Bar(score: Float) val w: BSONDocumentWriter[Bar] = Macros.using[MacroOptions.Verbose].writer[Bar]
- trait \/[A, B] extends AnyRef
Type for making type-level lists for UnionType.
Type for making type-level lists for UnionType. If second parameter is another \/ it will be flattend out into a list and so on. Using infix notation makes much more sense since it then looks like a logical disjunction.
Foo \/ Bar \/ Baz
is interpreted as type Foo or type Bar or type Baz- Annotations
- @SuppressWarnings()
- See also
UnionType
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object ValueOf extends LowPriorityValueOfImplicits