pub enum DeclarationSource {
Declared {
document: PathBuf,
declared: Declaration,
},
Undeclared {
looked_in: PathBuf,
},
Unreadable {
reason: String,
},
}Expand description
What a repository’s own declaration said, or why this build has no answer from it.
Three states, and the third is why this is a value rather than an
Option<Declaration>: a declaration this build could not read is not a
repository that declares nothing. A consumer waiting on a release holds
indefinitely on the first and acts on the second, so collapsing them here would
be the “not answered is not not released” mistake made one layer up.
Variants§
Declared
The repository declares what it publishes, and this build read it.
Fields
declared: DeclarationWhat that document declares.
Undeclared
The repository carries no declaration: nothing in it says what it publishes, so this host’s own document is the whole answer.
Unreadable
What this repository declares is unknown — there is nowhere to read a declaration from, or the one that is there is not a declaration this build can read.
Never “it declares nothing”: whatever targets are answered alongside this may be fewer than the repository publishes.
Implementations§
Source§impl DeclarationSource
impl DeclarationSource
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
How this state is spelled in a rendering and in the JSON document.
Sourcepub fn declared(&self) -> Option<&Declaration>
pub fn declared(&self) -> Option<&Declaration>
What the repository declares, where this build read a declaration.
Sourcepub fn unreadable(&self) -> Option<&str>
pub fn unreadable(&self) -> Option<&str>
Why what this repository publishes is unknown, where it is.
A caller that has to say “there may be more targets than these” asks this,
and gets None for both states in which the answer is complete.
Trait Implementations§
Source§impl Clone for DeclarationSource
impl Clone for DeclarationSource
Source§impl Debug for DeclarationSource
impl Debug for DeclarationSource
Source§impl<'de> Deserialize<'de> for DeclarationSource
impl<'de> Deserialize<'de> for DeclarationSource
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>,
impl Eq for DeclarationSource
Source§impl PartialEq for DeclarationSource
impl PartialEq for DeclarationSource
Source§impl Serialize for DeclarationSource
impl Serialize for DeclarationSource
impl StructuralPartialEq for DeclarationSource
Auto Trait Implementations§
impl Freeze for DeclarationSource
impl RefUnwindSafe for DeclarationSource
impl Send for DeclarationSource
impl Sync for DeclarationSource
impl Unpin for DeclarationSource
impl UnsafeUnpin for DeclarationSource
impl UnwindSafe for DeclarationSource
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.