gossamer/url
Types
Values
pub fn can_parse_with_base(
url: String,
relative_to base: String,
) -> Bool
pub fn create_object_url(blob: blob.Blob) -> String
Creates a string containing a URL representing the given blob. The URL lifetime is tied to the document or worker that created it.
pub fn new(url: String) -> Result(URL, js_error.JsError)
Parses url into a URL. Returns an error if the string is not a
valid absolute URL.
pub fn new_with_base(
url: String,
relative_to base: String,
) -> Result(URL, js_error.JsError)
Parses url, resolving relative URLs against base. Returns an error
if the resolved URL is invalid.
pub fn parse(url: String) -> Result(URL, Nil)
Like new, but returns Error(Nil) rather than a JsError when the
URL is invalid.
pub fn parse_with_base(
url: String,
relative_to base: String,
) -> Result(URL, Nil)
Like new_with_base, but returns Error(Nil) rather than a JsError
when the URL is invalid.
pub fn revoke_object_url(url: String) -> Nil
Revokes an object URL previously created with create_object_url. Call
this to release the reference once the URL is no longer needed.
pub fn search_params(
of url: URL,
) -> url_search_params.URLSearchParams
pub fn set_href(
of url: URL,
to href: String,
) -> Result(URL, js_error.JsError)
Sets the full URL string, reparsing it. Returns an error if the new
href is not a valid URL.