pub struct UrlDigestDep {
pub url: Url,
pub etag: Option<String>,
pub last_modified: Option<String>,
pub url_content_digest: Option<UrlContentDigest>,
}
Expand description
Invalidates when header of the URL get request changes.
Fields§
§url: Url
URL like https://example.com/my-file.html
etag: Option<String>
ETag header from the HEAD request
last_modified: Option<String>
Last-Modified header from the HEAD request
url_content_digest: Option<UrlContentDigest>
Digest of the content from the URL
Implementations§
Source§impl UrlDigestDep
impl UrlDigestDep
Sourcepub fn new(url: Url) -> Self
pub fn new(url: Url) -> Self
Create a new URL dependency with the given URL and empty headers and content digest.
Sourcepub fn update_headers(self) -> Result<Self>
pub fn update_headers(self) -> Result<Self>
Make a HEAD request and fill Etag and Last-Modified headers.
Sourcepub fn update_content_digest(self) -> Result<Self>
pub fn update_content_digest(self) -> Result<Self>
Make a GET request, download the content and fill the content digest.
Trait Implementations§
Source§impl Clone for UrlDigestDep
impl Clone for UrlDigestDep
Source§fn clone(&self) -> UrlDigestDep
fn clone(&self) -> UrlDigestDep
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UrlDigestDep
impl Debug for UrlDigestDep
Source§impl<'de> Deserialize<'de> for UrlDigestDep
impl<'de> Deserialize<'de> for UrlDigestDep
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
Source§impl Diffable for UrlDigestDep
impl Diffable for UrlDigestDep
Source§fn diff_superficial(
record: &Self::Item,
actual: &Self::Item,
) -> Diff<Self::Item>
fn diff_superficial( record: &Self::Item, actual: &Self::Item, ) -> Diff<Self::Item>
⚠️ Call actual.update_headers before calling this. ⚠️
Source§fn diff_thorough(record: &Self::Item, actual: &Self::Item) -> Diff<Self::Item>
fn diff_thorough(record: &Self::Item, actual: &Self::Item) -> Diff<Self::Item>
⚠️ Call actual.update_content_digest before calling this. ⚠️
Source§fn diff(
record: Option<&Self::Item>,
actual: Option<&Self::Item>,
) -> Diff<Self::Item>
fn diff( record: Option<&Self::Item>, actual: Option<&Self::Item>, ) -> Diff<Self::Item>
⚠️ Call actual.update_content_digest before calling this. ⚠️
Source§type Item = UrlDigestDep
type Item = UrlDigestDep
The type of the entity to compare.
Source§impl From<UrlDigestDep> for XvcDependency
impl From<UrlDigestDep> for XvcDependency
Source§fn from(val: UrlDigestDep) -> Self
fn from(val: UrlDigestDep) -> Self
Converts to this type from the input type.
Source§impl Ord for UrlDigestDep
impl Ord for UrlDigestDep
Source§fn cmp(&self, other: &UrlDigestDep) -> Ordering
fn cmp(&self, other: &UrlDigestDep) -> Ordering
1.21.0 · 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
Source§impl PartialEq for UrlDigestDep
impl PartialEq for UrlDigestDep
Source§impl PartialOrd for UrlDigestDep
impl PartialOrd for UrlDigestDep
Source§impl Serialize for UrlDigestDep
impl Serialize for UrlDigestDep
Source§impl Storable for UrlDigestDep
impl Storable for UrlDigestDep
Source§fn type_description() -> String
fn type_description() -> String
A string representation for the type. Read more
impl Eq for UrlDigestDep
impl StructuralPartialEq for UrlDigestDep
Auto Trait Implementations§
impl Freeze for UrlDigestDep
impl RefUnwindSafe for UrlDigestDep
impl Send for UrlDigestDep
impl Sync for UrlDigestDep
impl Unpin for UrlDigestDep
impl UnwindSafe for UrlDigestDep
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more