pub struct FetchResult { /* private fields */ }Expand description
Bounded normalized result returned by a client fetch backend.
Implementations§
Source§impl FetchResult
impl FetchResult
Sourcepub fn new(
requested_url: impl Into<String>,
final_url: impl Into<String>,
mime_type: impl Into<String>,
body: impl Into<String>,
) -> Result<Self, FetchProviderError>
pub fn new( requested_url: impl Into<String>, final_url: impl Into<String>, mime_type: impl Into<String>, body: impl Into<String>, ) -> Result<Self, FetchProviderError>
Creates a result with bounded URLs, MIME, and body content.
§Errors
Rejects malformed URLs, unsupported MIME syntax, oversized body/title values, and more than ten redirect records.
Sourcepub fn new_with_policy(
requested_url: impl Into<String>,
final_url: impl Into<String>,
mime_type: impl Into<String>,
body: impl Into<String>,
policy: &FetchUrlPolicy,
) -> Result<Self, FetchProviderError>
pub fn new_with_policy( requested_url: impl Into<String>, final_url: impl Into<String>, mime_type: impl Into<String>, body: impl Into<String>, policy: &FetchUrlPolicy, ) -> Result<Self, FetchProviderError>
Sourcepub fn with_title(
self,
title: impl Into<String>,
) -> Result<Self, FetchProviderError>
pub fn with_title( self, title: impl Into<String>, ) -> Result<Self, FetchProviderError>
Sourcepub const fn with_truncation(self, reason: FetchTruncationReason) -> Self
pub const fn with_truncation(self, reason: FetchTruncationReason) -> Self
Marks the result as truncated for a bounded reason.
Sourcepub fn with_redirects(
self,
redirects: Vec<FetchRedirect>,
) -> Result<Self, FetchProviderError>
pub fn with_redirects( self, redirects: Vec<FetchRedirect>, ) -> Result<Self, FetchProviderError>
Sourcepub fn requested_url(&self) -> &str
pub fn requested_url(&self) -> &str
Returns the originally requested URL.
Sourcepub const fn truncation(&self) -> Option<FetchTruncationReason>
pub const fn truncation(&self) -> Option<FetchTruncationReason>
Returns the truncation reason, if the body was bounded.
Sourcepub fn redirects(&self) -> &[FetchRedirect]
pub fn redirects(&self) -> &[FetchRedirect]
Returns normalized redirect records.
Trait Implementations§
Source§impl Clone for FetchResult
impl Clone for FetchResult
Source§impl Debug for FetchResult
impl Debug for FetchResult
Source§impl<'de> Deserialize<'de> for FetchResult
impl<'de> Deserialize<'de> for FetchResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FetchResult
Source§impl PartialEq for FetchResult
impl PartialEq for FetchResult
Source§impl Serialize for FetchResult
impl Serialize for FetchResult
impl StructuralPartialEq for FetchResult
Auto Trait Implementations§
impl Freeze for FetchResult
impl RefUnwindSafe for FetchResult
impl Send for FetchResult
impl Sync for FetchResult
impl Unpin for FetchResult
impl UnsafeUnpin for FetchResult
impl UnwindSafe for FetchResult
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.