Enum ark_api::http_request::Url
source · pub enum Url {
Static(&'static str),
StaticDomain {
domain: &'static str,
path: Cow<'static, str>,
},
}Expand description
URL for HTTP requests
This is intentionally quite restricted to use static domains and protocols for security and simplicity purposes
Variants§
Static(&'static str)
Fully static full URL
This is required to start with https:// protocol
StaticDomain
Fields
URL with static domain and static or dynamic path
Implementations§
source§impl Url
impl Url
sourcepub const fn const_from_str(url: &'static str) -> Self
pub const fn const_from_str(url: &'static str) -> Self
Create a new URL from static string
This is required to start with https:// protocol, but this is currently not validated at compile-time
Example
const TARGET: Url = Url::const_from_str("https://google.com/search?q=rust")sourcepub const fn const_with_path(domain: &'static str, path: &'static str) -> Self
pub const fn const_with_path(domain: &'static str, path: &'static str) -> Self
Create a new URL from a static domain and path
Example
const TARGET: Url = Url::const_with_path("google.com", "/search?q=rust")