Skip to content

WebLink

[Source]

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.

class val WebLink is
  Stringable box,
  Equatable[WebLink val] ref

Implements


Constructors

create

[Source]

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


Public fields

let target: String val

[Source]


let params: HashMap[String val, String val, HashEq[String val] val] val

[Source]


Public Functions

rel

[Source]

Return the value of the rel parameter, or an empty string if absent.

fun box rel()
: String val

Returns


param

[Source]

Look up a parameter by name. Returns None if absent.

fun box param(
  name: String val)
: (String val | None val)

Parameters

Returns


eq

[Source]

Two links are equal when their targets and all parameter key-value pairs match.

fun box eq(
  that: WebLink box)
: Bool val

Parameters

Returns


string

[Source]

Serialize to link-value format. Parameter values are always quoted. rel is emitted first; remaining parameters are sorted alphabetically for deterministic output.

fun box string()
: String iso^

Returns


ne

fun box ne(
  that: WebLink val)
: Bool val

Parameters

Returns