pub struct SubscriptionSource { /* private fields */ }Expand description
A subscription URL whose debug representation reveals only a stable hash.
Implementations§
Source§impl SubscriptionSource
impl SubscriptionSource
Sourcepub fn new(value: &str) -> Result<Self>
pub fn new(value: &str) -> Result<Self>
Accept an HTTP(S) URL. Query parameters and credentials remain private.
Sourcepub fn key(&self) -> String
pub fn key(&self) -> String
SHA-256 of the normalized URL, suitable for isolating subscription caches.
Sourcepub async fn fetch(
&self,
client: &Client,
max_bytes: usize,
) -> Result<ParseReport>
pub async fn fetch( &self, client: &Client, max_bytes: usize, ) -> Result<ParseReport>
Download and parse a subscription with a streaming response-size limit.
max_bytes must be positive. The supplied client’s timeout,
redirect, and proxy policies apply. HTTP failure responses are rejected.
Sourcepub async fn fetch_update(
&self,
client: &Client,
max_bytes: usize,
validators: Option<&SubscriptionValidators>,
) -> Result<SubscriptionUpdate>
pub async fn fetch_update( &self, client: &Client, max_bytes: usize, validators: Option<&SubscriptionValidators>, ) -> Result<SubscriptionUpdate>
Download a subscription, optionally revalidating previously obtained nodes.
Sends If-None-Match and/or If-Modified-Since from validators. A 304
response succeeds only when at least one validator was actually sent; it
has no body to parse. Callers must retain the matching nodes themselves.
A modified response replaces the old validators, including clearing any
that the server no longer sends. No automatic retries are performed.
max_bytes is a positive limit on the downloaded and decoded document.
The supplied client’s timeout, redirect, and proxy policies apply.
Trait Implementations§
Source§impl Clone for SubscriptionSource
impl Clone for SubscriptionSource
Source§fn clone(&self) -> SubscriptionSource
fn clone(&self) -> SubscriptionSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more