WebLink¶
A single parsed link from an RFC 8288 Link header.
Each WebLink has a target URI-Reference and a set of params.
The rel parameter is always present on links produced by
ParseLinkHeader; direct construction does not enforce this.
Implements¶
- Stringable box
- Equatable[WebLink val] ref
Constructors¶
create¶
Create a WebLink with the given target URI-Reference and parameters.
The parser guarantees rel presence; direct construction is at the
caller's risk.
new val create(
target': String val,
params': HashMap[String val, String val, HashEq[String val] val] val)
: WebLink val^
Parameters¶
Returns¶
- WebLink val^
Public fields¶
let target: String val¶
let params: HashMap[String val, String val, HashEq[String val] val] val¶
Public Functions¶
rel¶
Return the value of the rel parameter, or an empty string if absent.
Returns¶
- String val
param¶
Look up a parameter by name. Returns None if absent.
Parameters¶
- name: String val
Returns¶
eq¶
Two links are equal when their targets and all parameter key-value pairs match.
Parameters¶
- that: WebLink box
Returns¶
- Bool val
string¶
Serialize to link-value format. Parameter values are always quoted.
rel is emitted first; remaining parameters are sorted alphabetically
for deterministic output.
Returns¶
- String iso^
ne¶
Parameters¶
- that: WebLink val
Returns¶
- Bool val