pub struct FetchUrlPolicy { /* private fields */ }Expand description
Immutable URL validation policy used before DNS resolution.
Implementations§
Source§impl FetchUrlPolicy
impl FetchUrlPolicy
Sourcepub const fn production() -> Self
pub const fn production() -> Self
Creates the production policy: HTTPS and the default port only.
Sourcepub const fn loopback_tests() -> Self
pub const fn loopback_tests() -> Self
Creates an explicit local-fixture policy.
This policy permits http only for literal loopback addresses or
localhost; address validation must still permit and verify loopback.
Product configuration must use Self::production.
Sourcepub fn validate(
&self,
value: &str,
) -> Result<ValidatedFetchUrl, FetchUrlPolicyError>
pub fn validate( &self, value: &str, ) -> Result<ValidatedFetchUrl, FetchUrlPolicyError>
Normalizes and validates one URL without resolving its host.
§Errors
Rejects invalid IDNA hosts, credentials, unsupported schemes, unsafe ports, controls, whitespace, and oversized values. Fragments are deliberately removed because they are not part of HTTP requests or cache keys.
Trait Implementations§
Source§impl Clone for FetchUrlPolicy
impl Clone for FetchUrlPolicy
impl Copy for FetchUrlPolicy
Source§impl Debug for FetchUrlPolicy
impl Debug for FetchUrlPolicy
Source§impl Default for FetchUrlPolicy
impl Default for FetchUrlPolicy
impl Eq for FetchUrlPolicy
Source§impl Ord for FetchUrlPolicy
impl Ord for FetchUrlPolicy
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FetchUrlPolicy
impl PartialEq for FetchUrlPolicy
Source§impl PartialOrd for FetchUrlPolicy
impl PartialOrd for FetchUrlPolicy
impl StructuralPartialEq for FetchUrlPolicy
Auto Trait Implementations§
impl Freeze for FetchUrlPolicy
impl RefUnwindSafe for FetchUrlPolicy
impl Send for FetchUrlPolicy
impl Sync for FetchUrlPolicy
impl Unpin for FetchUrlPolicy
impl UnsafeUnpin for FetchUrlPolicy
impl UnwindSafe for FetchUrlPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.