pub struct LeanResult {
pub receipt: Receipt,
pub target_lean: String,
pub target_logos: Option<String>,
pub assumptions: Vec<String>,
pub information_losses: Vec<Loss>,
pub diagnostics: Vec<Diagnostic>,
pub audit: Option<Value>,
pub package: Option<PackageRef>,
}Expand description
A logos-lean-result/1 document under construction.
Fields§
§receipt: Receipt§target_lean: String§target_logos: Option<String>§assumptions: Vec<String>§information_losses: Vec<Loss>§diagnostics: Vec<Diagnostic>§audit: Option<Value>The importer’s audit (logos-lean-import-report/1), when the import ran.
package: Option<PackageRef>Implementations§
Source§impl LeanResult
impl LeanResult
Sourcepub fn new(target_lean: impl Into<String>) -> LeanResult
pub fn new(target_lean: impl Into<String>) -> LeanResult
A result for target in which nothing has run.
pub fn status(&self, stage: &str) -> StageStatus
pub fn pass(&mut self, stage: &'static str, detail: impl Into<String>)
Sourcepub fn mark(
&mut self,
stage: &'static str,
status: StageStatus,
diagnostic: Diagnostic,
)
pub fn mark( &mut self, stage: &'static str, status: StageStatus, diagnostic: Diagnostic, )
Record stage as status for the reason diagnostic gives.
Sourcepub fn fail(&mut self, stage: &'static str, diagnostic: Diagnostic)
pub fn fail(&mut self, stage: &'static str, diagnostic: Diagnostic)
stage failed for the reason diagnostic gives.
Sourcepub fn outcome(&self) -> Outcome
pub fn outcome(&self) -> Outcome
The outcome: the first stage that failed decides it; otherwise every stage passed
(verified), or the first stage that did not decides it.
pub fn exit_code(&self) -> i32
Sourcepub fn finish(&mut self)
pub fn finish(&mut self)
Explain a stage that did not run where it decides the outcome: when nothing failed, a
lean_accepted stage that was never observed is the reason the result is not verified.
pub fn to_json(&self) -> Value
Trait Implementations§
Source§impl Clone for LeanResult
impl Clone for LeanResult
Source§fn clone(&self) -> LeanResult
fn clone(&self) -> LeanResult
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 LeanResult
impl Debug for LeanResult
Source§impl PartialEq for LeanResult
impl PartialEq for LeanResult
impl StructuralPartialEq for LeanResult
Auto Trait Implementations§
impl Freeze for LeanResult
impl RefUnwindSafe for LeanResult
impl Send for LeanResult
impl Sync for LeanResult
impl Unpin for LeanResult
impl UnsafeUnpin for LeanResult
impl UnwindSafe for LeanResult
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.