#[non_exhaustive]pub struct TierThreeLicenseFetch {
pub licenses: HashMap<PackageName, Vec<String>>,
pub timed_out: usize,
}Expand description
Result of prefetch_tier3_licenses/fetch_tier3_licenses.
§Examples
use deps_engine::classify::license::TierThreeLicenseFetch;
use std::collections::HashMap;
let result = TierThreeLicenseFetch::new(HashMap::new(), 0);
assert!(result.licenses.is_empty());
assert_eq!(result.timed_out, 0);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.licenses: HashMap<PackageName, Vec<String>>The successfully fetched licenses, keyed by (already scheme-qualified where
applicable, e.g. jsr:@std/fs) package name. A dependency absent from this map means
either its fetch found no license, or it was skipped by tier3_license_targets —
the two are indistinguishable here (see Self::timed_out’s doc for why only a
timeout is ever observable as a distinct failure mode).
timed_out: usizeHow many per-dependency fetches were cut off by this function’s own
tokio::time::timeout (issue #1133 critic S1).
A partial, best-effort “could this result be trusted” signal, not a full
fetch-failure count: deps_core::Ecosystem::fetch_license returns a bare
Vec<String> with no error channel, and every one of the four tier-3 implementations
(Dart/Swift/Gradle/Deno) deliberately degrades a network error, a 404, or a GitHub
rate limit to an empty Vec internally, before this function ever sees it — that
class of failure is indistinguishable from “genuinely no license” and is not
counted here. Only this function’s own outer timeout firing is observable from
outside the ecosystem crate’s own implementation. Callers that need a
“network-reachable” signal (e.g. deps-cli’s registry_unreachable/exit-code gate)
should treat a non-zero count as at least one confirmed unreachable tier-3 source,
while treating zero as “no confirmed failure” rather than “fully verified reachable”.
Implementations§
Source§impl TierThreeLicenseFetch
impl TierThreeLicenseFetch
Sourcepub const fn new(
licenses: HashMap<PackageName, Vec<String>>,
timed_out: usize,
) -> Self
pub const fn new( licenses: HashMap<PackageName, Vec<String>>, timed_out: usize, ) -> Self
Constructs a result from its already-computed fields. #[non_exhaustive] blocks
cross-crate struct-literal construction even with every field named, so a caller
outside this crate (e.g. a deps-lsp/deps-cli unit test building a synthetic
result) needs this constructor instead.
§Examples
use deps_engine::classify::license::TierThreeLicenseFetch;
use std::collections::HashMap;
let result = TierThreeLicenseFetch::new(HashMap::new(), 2);
assert_eq!(result.timed_out, 2);Trait Implementations§
Source§impl Clone for TierThreeLicenseFetch
impl Clone for TierThreeLicenseFetch
Source§impl Debug for TierThreeLicenseFetch
impl Debug for TierThreeLicenseFetch
Source§impl Default for TierThreeLicenseFetch
impl Default for TierThreeLicenseFetch
impl Eq for TierThreeLicenseFetch
Source§impl PartialEq for TierThreeLicenseFetch
impl PartialEq for TierThreeLicenseFetch
impl StructuralPartialEq for TierThreeLicenseFetch
Auto Trait Implementations§
impl Freeze for TierThreeLicenseFetch
impl RefUnwindSafe for TierThreeLicenseFetch
impl Send for TierThreeLicenseFetch
impl Sync for TierThreeLicenseFetch
impl Unpin for TierThreeLicenseFetch
impl UnsafeUnpin for TierThreeLicenseFetch
impl UnwindSafe for TierThreeLicenseFetch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§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
key and return true if they are equal.