urldsl.language

Type members

Classlikes

final class AllImpl[P, Q, F] extends PathSegmentImpl[P] with QueryParametersImpl[Q] with FragmentImpl[F]
Companion
object
object AllImpl
Companion
class
trait Fragment[T, +E] extends UrlPart[T, E]

Represents the fragment (or ref) of an URL, containing an information of type T, or an error of type E.

Represents the fragment (or ref) of an URL, containing an information of type T, or an error of type E.

Type Params
E

type of the error that this PathSegment produces on "illegal" url paths.

T

type represented by this PathSegment

Companion
object
object Fragment
Companion
class
trait FragmentImpl[E]

This is the analogue of PathSegmentImpl for the Fragment trait. It "pre-applies" the error type based on the provided FragmentMatchingError.

This is the analogue of PathSegmentImpl for the Fragment trait. It "pre-applies" the error type based on the provided FragmentMatchingError.

Type Params
E

type of the "pre-applied" errors

Companion
object
object FragmentImpl
Companion
class
final class PathQueryFragmentRepr[PathType, +PathError, ParamsType, +ParamsError, FragmentType, +FragmentError] extends UrlPart[PathQueryFragmentMatching[PathType, ParamsType, FragmentType], PathQueryFragmentError[PathError, ParamsError, FragmentError]]
trait PathSegment[T, +A] extends UrlPart[T, A]

Represents a part of the path string of an URL, containing an information of type T, or an error of type A.

Represents a part of the path string of an URL, containing an information of type T, or an error of type A.

Type Params
A

type of the error that this PathSegment produces on "illegal" url paths.

T

type represented by this PathSegment

Companion
object
object PathSegment
Companion
class
trait PathSegmentImpl[A]

Using the pre-defined path segments in PathSegment can be cumbersome if you have to constantly specify the error type A, for example in the PathSegment.segment or PathSegment.root methods. Therefore, you can invoke an implementation of this class and import its members instead. We don't redefine PathSegment.intSegment and PathSegment.stringSegment since they can be easily and conveniently invoked using the segment method below.

Using the pre-defined path segments in PathSegment can be cumbersome if you have to constantly specify the error type A, for example in the PathSegment.segment or PathSegment.root methods. Therefore, you can invoke an implementation of this class and import its members instead. We don't redefine PathSegment.intSegment and PathSegment.stringSegment since they can be easily and conveniently invoked using the segment method below.

Type Params
A

type of error.

Example
        val pathSegmentImpl = PathSegmentImpl[DummyError]
        import pathSegmentImpl._
        root / "hello"  // this is of type PathSegment[Unit, DummyError] thanks to the import above.
         (note that in this case there is already a PathSegmentImpl for [[urldsl.errors.DummyError]] in the
         [[PathSegment]] companion object)
Companion
object
Companion
class
final class PathSegmentWithQueryParams[PathType, +PathError, ParamsType, +ParamsError] extends UrlPart[UrlMatching[PathType, ParamsType], Either[PathError, ParamsError]]
trait QueryParameters[Q, +A] extends UrlPart[Q, A]
Companion
object
Companion
class
Companion
object
Companion
class
trait Tupler[A, B]

Defines a strategy for tupling A and B values, according to types A and B.

Defines a strategy for tupling A and B values, according to types A and B.

The actual implementation avoids nested tuples and eliminates Unit, so that instead of ending with, e.g., the following type:

 ((Unit, Int), (((Unit, Unit), String)))

We just get:

 (Int, String)

The following rules are implemented (by increasing priority):

  • A, B -> (A, B)
  • A, (B, C) -> (A, B, C)
  • (A, B), C -> (A, B, C)
  • (A, B), (C, D) -> (A, B, C, D)
  • A, (B, C, D, E) -> (A, B, C, D, E)
  • (A, B), (C, D, E) -> (A, B, C, D, E)
  • (A, B, C), D -> (A, B, C, D)
  • (A, B, C, D), E -> (A, B, C, D, E)
  • (A, B, C, D, E), F -> (A, B, C, D, E, F)
  • A, Unit -> A
  • Unit, A -> A
Companion
object
object Tupler extends Tupler4
Companion
class
trait Tupler1
trait Tupler2 extends Tupler1
trait Tupler3 extends Tupler2
trait Tupler4 extends Tupler3
trait UrlPart[T, +E]

A UrlPart represents a part of (or the entire) URL and is able to extract some information out of it. When it succeeds to extract information, it returns an element of type T (wrapped in a Right). When it fails to extract such information, it returns an error type E (wrapped in a Left.

A UrlPart represents a part of (or the entire) URL and is able to extract some information out of it. When it succeeds to extract information, it returns an element of type T (wrapped in a Right). When it fails to extract such information, it returns an error type E (wrapped in a Left.

A UrlPart is also able to generate its corresponding part of the URL by ingesting an element of type T. When doing that, it outputs a String (whose semantic may vary depending on the type of UrlPart you are dealing with).

Companion
object
object UrlPart
Companion
class