WithContext
class WithContext[R, A, P, In, Ctx]A route being registered after its mount aspects, whose setup and LiveView read their context.
Accepts the same setup as LiveRouteSetup, in any order. Layouts, guards, and connected resources receive the context produced by the aspects before them.
Type parameters
Rthe services the mount aspects need
Athe values decoded from the path
Pthe parameters a LiveView.Routed receives
Inthe context the route reads from an enclosing named live session
Ctxthe context produced so far, which the LiveView's factory receives
Defined by scalive.LiveRouteSetup.WithContext. View source (scalive/api/src/scalive/routing/LiveRouting.scala:382-527)
Methods8
->
def ->: [View](view: => View)(using mount: LiveRouteView[View, P])(LiveRegistration[R] { type Input = In })Registers the LiveView this route mounts after its mount aspects succeed.
Defined by scalive.LiveRouteSetup.WithContext.->. View source (scalive/api/src/scalive/routing/LiveRouting.scala:471-476)
context
def context: [View](factory: Ctx => View)(using mount: LiveRouteView[View, P])(LiveRegistration[R] { type Input = In })Registers a LiveView built from the aspects' context.
A tuple context arrives as separate parameters, as in
.context((user, access) => WorkspaceLiveView(user, access)).
Defined by scalive.LiveRouteSetup.WithContext.context. View source (scalive/api/src/scalive/routing/LiveRouting.scala:494-499)
from
def from: [R1, View](factory: Ctx => zio.package.URIO[R1, View])(using mount: LiveRouteView[View, P])(LiveRegistration[&[R, R1]] { type Input = In })Registers a LiveView built from services in the application environment.
This form also reads the aspects' context.
Defined by scalive.LiveRouteSetup.WithContext.from. View source (scalive/api/src/scalive/routing/LiveRouting.scala:505-510)
def from: [R1, View](factory: zio.package.URIO[R1, View])(using mount: LiveRouteView[View, P])(LiveRegistration[&[R, R1]] { type Input = In })Registers a LiveView built from services in the application environment.
The services are provided after the mount aspects succeed.
Defined by scalive.LiveRouteSetup.WithContext.from. View source (scalive/api/src/scalive/routing/LiveRouting.scala:482-487)
guardConnectedTurns
def guardConnectedTurns[Result <: Unit](guard: Ctx => zio.package.IO[LiveConnectedTurnFailure, Result]): LiveRouteSetup.WithContext[R, A, P, In, Ctx]Appends a policy check before each connected application turn, with the aspects' context.
Guards at one boundary run in declaration order; session guards run before route guards.
Succeed with Unit to continue, or fail with LiveConnectedTurnFailure for a controlled
halt, redirect, reload, or disconnect.
Defined by scalive.LiveRouteSetup.WithContext.guardConnectedTurns. View source (scalive/api/src/scalive/routing/LiveRouting.scala:457-460)
withConnectedResources
def withConnectedResources[Result <: Unit](initialize: (Ctx, ConnectedResources) => zio.package.Task[Result]): LiveRouteSetup.WithContext[R, A, P, In, Ctx]Appends connected setup that receives the aspects' context.
Defined by scalive.LiveRouteSetup.WithContext.withConnectedResources. View source (scalive/api/src/scalive/routing/LiveRouting.scala:463-468)
withLayout
def withLayout(layout: LiveLayout[A, Ctx]): LiveRouteSetup.WithContext[R, A, P, In, Ctx]Wraps this route's LiveView in a layout that can read the aspects' context.
Defined by scalive.LiveRouteSetup.WithContext.withLayout. View source (scalive/api/src/scalive/routing/LiveRouting.scala:424-425)
def withLayout[LayoutContext](layout: LiveLayout[A, LayoutContext], select: Ctx => LayoutContext): LiveRouteSetup.WithContext[R, A, P, In, Ctx]Wraps this route's LiveView in a layout that can read the aspects' context.
This form selects the layout's input from the context available here. The pure selector adapts only the layout; later aspects preserve this selection.
Defined by scalive.LiveRouteSetup.WithContext.withLayout. View source (scalive/api/src/scalive/routing/LiveRouting.scala:432-435)
withMountAspect
def withMountAspect[R1, Out, Result](aspect: LiveRouteMountAspect[R1, A, Ctx, Out])(using append: ContextAppend.Aux[Ctx, Out, Result]): LiveRouteSetup.WithContext[&[R, R1], A, P, In, Result]Runs another mount aspect after the previous ones and adds its output to the context.
Defined by scalive.LiveRouteSetup.WithContext.withMountAspect. View source (scalive/api/src/scalive/routing/LiveRouting.scala:409-421)
withRootLayout
def withRootLayout(layout: LiveRootLayout[A, Ctx]): LiveRouteSetup.WithContext[R, A, P, In, Ctx]Renders this route's document with a root layout that can read the aspects' context.
Defined by scalive.LiveRouteSetup.WithContext.withRootLayout. View source (scalive/api/src/scalive/routing/LiveRouting.scala:438-439)
def withRootLayout[LayoutContext](layout: LiveRootLayout[A, LayoutContext], select: Ctx => LayoutContext): LiveRouteSetup.WithContext[R, A, P, In, Ctx]Renders this route's document with a root layout that can read the aspects' context.
This form selects the layout's input from the context available here. Key and view select independently, so the selector must be pure and deterministic.
Defined by scalive.LiveRouteSetup.WithContext.withRootLayout. View source (scalive/api/src/scalive/routing/LiveRouting.scala:446-449)