Path is an immutable representation of a urls path. Internally it stores each
element of a path in a sequence of Segment. This allows for powerful
compositional APIs.
- Companion:
- object
Value members
Concrete methods
Combines two paths together to create a new one. In the process it will remove all extra slashes from the final path, leaving only the ones that are at the ends.
Combines two paths together to create a new one. In the process it will remove all extra slashes from the final path, leaving only the ones that are at the ends.
Appends a segment at the end of the path. To append a trailing slash use an empty string.
Appends a segment at the end of the path. To append a trailing slash use an empty string.
Prepends the path with the provided segment. To prepend a leading slash use an empty string.
Prepends the path with the provided segment. To prepend a leading slash use an empty string.
Returns a new path that contains only the inital segments, leaving the last segment.
Returns a new path that contains only the inital segments, leaving the last segment.
Returns a the last element of the path. If the path contains a trailing
slash, None will be returned.
Returns a the last element of the path. If the path contains a trailing
slash, None will be returned.
Creates a new path from this one with it's segments reversed.
Creates a new path from this one with it's segments reversed.
Creates a new path with the provided n initial segments.
Creates a new path with the provided n initial segments.