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")Trait Implementations§
impl StructuralPartialEq for Url
Auto Trait Implementations§
impl RefUnwindSafe for Url
impl Send for Url
impl Sync for Url
impl Unpin for Url
impl UnwindSafe for Url
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more