Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
c

LiveLocation

class LiveLocation

An encoded destination produced by a typed Live route.

Construction is kept behind route codecs so application navigation does not accidentally skip path or query validation. Use a route's locationEither method at checked boundaries and its location convenience method when invalid application values are programmer errors.

Defined by scalive.LiveLocation. View source (scalive/api/src/scalive/LiveLocation.scala:12-61)

Methods4

href

def href: String

Returns the encoded path, query, and optional fragment suitable for an HTML href.

Returns

Returns

the encoded destination

Defined by scalive.LiveLocation.href. View source (scalive/api/src/scalive/LiveLocation.scala:18-18)

seeOther

def seeOther: zio.http.Response

Returns an HTTP 303 See Other response targeting this location.

Defined by scalive.LiveLocation.seeOther. View source (scalive/api/src/scalive/LiveLocation.scala:21-21)

withFragment

def withFragment(fragment: String): LiveLocation

Returns a copy with fragment as its URI fragment.

fragment must already use percent-encoded URI-fragment syntax. This method validates but does not encode decoded text; callers must encode spaces, for example as %20, before passing it.

Parameters

fragment

a percent-encoded URI fragment without the leading #

Returns

Returns

the updated location

Throws

LiveLocation.EncodingException

if the fragment syntax is invalid

Defined by scalive.LiveLocation.withFragment. View source (scalive/api/src/scalive/LiveLocation.scala:36-40)

withFragmentEither

def withFragmentEither(fragment: String): Either[LiveLocation.EncodeError, LiveLocation]

Returns a checked copy with fragment as its URI fragment.

fragment must already use percent-encoded URI-fragment syntax. This method validates but does not encode decoded text; callers must encode spaces, for example as %20, before passing it.

Parameters

fragment

a percent-encoded URI fragment without the leading #

Returns

Returns

the updated location, or Fragment for invalid syntax

Defined by scalive.LiveLocation.withFragmentEither. View source (scalive/api/src/scalive/LiveLocation.scala:53-60)