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
Value members
Abstract methods
Creates a fragment information from an instance of T.
Creates a fragment information from an instance of T.
Concrete methods
Turns this fragment matching a T
into a fragment matching an Option of T.
It will return Some(t) if t could be extracted, and None otherwise.
Turns this fragment matching a T
into a fragment matching an Option of T.
It will return Some(t) if t could be extracted, and None otherwise.
The failure that happened and led to an error does not matter: it will result in None, no matter what.
Adds an extra satisfying criteria to the de-serialized output of this Fragment. When the output of this Fragment does not satisfy the given predicate, the given error is returned instead.
Adds an extra satisfying criteria to the de-serialized output of this Fragment. When the output of this Fragment does not satisfy the given predicate, the given error is returned instead.
- Type Params
- E1
new type of the error
- Value Params
- error
error happening when it's not the case
- predicate
criteria that the output has to verify
- Returns
a new Fragment matching the same fragment information, but only when the predicate is satisfied
Creates the Fragment string contained in the given instance of T. Automatically prepend # if non empty.
Creates the Fragment string contained in the given instance of T. Automatically prepend # if non empty.
Returns a Fragment which outputs the contents of this Fragment when result is a Some and the
specified default
value otherwise.
When generating the path, it will only generate paths corresponding to the Some case.
Returns a Fragment which outputs the contents of this Fragment when result is a Some and the
specified default
value otherwise.
When generating the path, it will only generate paths corresponding to the Some case.
- Value Params
- default
default value when output is empty
- Note
This method is only available when
T =:= Option[U]
.