All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kreuzberg.AssemblerContext.scala Maven / Gradle / Ivy

There is a newer version: 0.10.3
Show newest version
package kreuzberg

/** Provides values for models. */
trait ModelValueProvider {

  /** Returns the value of a model. */
  def value[M](model: Subscribeable[M]): M

}

/** Provided context for assembling operations. */
trait AssemblerContext extends ModelValueProvider with ServiceRepository

object AssemblerContext {
  def empty: Empty = new Empty

  /** An Empty assembler context. */
  class Empty extends ModelValueProvider with AssemblerContext {
    override def value[M](model: Subscribeable[M]): M = model.initial(using this)

    override def serviceOption[S](using snp: ServiceNameProvider[S]): Option[S] = None
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy