From 67433b43be54ec9c3f0b8c56e49440ef21a0153a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 13 Dec 2024 05:26:26 +0100 Subject: [PATCH] `rd`: Split `GetFetchFailures` into single-protocol and multi-prtocol variants --- acrate_rd/src/any.rs | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/acrate_rd/src/any.rs b/acrate_rd/src/any.rs index 99acb96..eca9ef5 100644 --- a/acrate_rd/src/any.rs +++ b/acrate_rd/src/any.rs @@ -262,25 +262,27 @@ pub enum GetError { Fetch(GetFetchFailures), } -/// Request errors occurred during [`ResourceDescriptor::discover`]. +/// Request errors occurred during [`ResourceDescriptor::discover_http`] or [`ResourceDescriptor::discover`]. #[derive(Debug, Error)] #[error("all attempts of fetching the resource descriptor document failed")] pub struct GetFetchFailures { - /// HTTPS XRD retrieval. - pub https_xrd: GetXRDError, + /// XRD retrieval. + pub xrd: GetXRDError, - /// HTTPS JRD retrieval. - pub https_jrd: GetJRDError, + /// JRD retrieval. + pub jrd: GetJRDError, - /// HTTPS JRD with .json extension retrieval. - pub https_jrdj: GetJRDError, - - /// HTTPS XRD retrieval. - pub http_xrd: GetXRDError, - - /// HTTP JRD retrieval. - pub http_jrd: GetJRDError, - - /// HTTP JRD with .json extension retrieval. - pub http_jrdj: GetJRDError, + /// JRD with .json extension retrieval. + pub jrdj: GetJRDError, +} + +/// Request errors occurred during [`ResourceDescriptor::discover`]. +#[derive(Debug, Error)] +#[error("all attempts of fetching the resource descriptor document failed with all protocols")] +pub struct GetFetchFailuresMultiprotocol { + /// HTTPS. + pub https: GetFetchFailures, + + /// HTTP. + pub http: GetFetchFailures, }