PathSegment

object PathSegment
Companion
class
class Object
trait Matchable
class Any

Type members

Types

A Type of path segment where we don't care about the error.

A Type of path segment where we don't care about the error.

Value members

Concrete methods

final def empty: PathSegment[Unit, Nothing]

Simple path segment that matches everything by passing segments down the line.

Simple path segment that matches everything by passing segments down the line.

final def endOfSegments[A](pathMatchingError: PathMatchingError[A]): PathSegment[Unit, A]

Check that the segments ends at this point.

Check that the segments ends at this point.

def factory[T, A](matching: List[Segment] => Either[A, PathMatchOutput[T]], creating: T => List[Segment]): PathSegment[T, A]

Trait factory

Trait factory

final def intSegment[A](pathMatchingError: PathMatchingError[A], fromThrowable: ErrorFromThrowable[A]): PathSegment[Int, A]

Matches a simple Int and tries to convert it to an Int.

Matches a simple Int and tries to convert it to an Int.

final def noMatch[A](pathMatchingError: PathMatchingError[A]): PathSegment[Unit, A]

Simple path segment that matches nothing. This is the neutral of the || operator.

Simple path segment that matches nothing. This is the neutral of the || operator.

final def oneOf[T, A](t: T, ts: T*)(fromString: FromString[T, A], printer: Printer[T], pathMatchingError: PathMatchingError[A]): PathSegment[Unit, A]

PathSegment that matches one of the given different possibilities.

PathSegment that matches one of the given different possibilities.

This can be useful in a Router, when you want to delegate the final decision to an inner router. Since all possibilities are good, the creation of segment simply takes the first one.

final def remainingSegments[A]: PathSegment[List[String], A]

Consumes all the remaining segments.

Consumes all the remaining segments.

This can be useful for static resources.

final def root: PathSegment[Unit, Nothing]
final def segment[T, A](fromString: FromString[T, A], printer: Printer[T], error: PathMatchingError[A]): PathSegment[T, A]

Creates a segment matching any element of type T, as long as the urldsl.vocabulary.FromString can de-serialize it.

Creates a segment matching any element of type T, as long as the urldsl.vocabulary.FromString can de-serialize it.

final def simplePathSegment[T, A](matching: Segment => Either[A, T], creating: T => Segment)(pathMatchingError: PathMatchingError[A]): PathSegment[T, A]

Simple trait factory for "single segment"-oriented path Segments.

Simple trait factory for "single segment"-oriented path Segments.

This can be used to match a simple String, or a simple Int, etc...

final def stringSegment[A](pathMatchingError: PathMatchingError[A]): PathSegment[String, A]

Matches a simple String and returning it.

Matches a simple String and returning it.

Implicits

Implicits

final implicit def unaryPathSegment[T, A](t: T)(fromString: FromString[T, A], printer: Printer[T], pathMatchingError: PathMatchingError[A]): PathSegment[Unit, A]

Returns a urldsl.language.PathSegment which matches exactly the argument t.

Returns a urldsl.language.PathSegment which matches exactly the argument t.

This conversion is implicit if you can provide a urldsl.vocabulary.FromString and a urldsl.vocabulary.Printer, so that it enables writing, e.g., root / "hello" / true