Skip to main content

Outcome

Struct Outcome 

Source
pub struct Outcome {
    pub products: ProductSet,
    pub reactants: Vec<MolBuilder>,
    pub discarded: Vec<Vec<u32>>,
}
Expand description

一个匹配组合跑出来的结果。

Fields§

§products: ProductSet

产物。数目由连通性决定,不由产物模板数决定,见 ProductSet

§reactants: Vec<MolBuilder>

带映射号的反应物副本。

只在开启 atom_mapping 时非空。 关掉时反应物一个字节都不会被改动, 调用方手上的输入就是答案,复制一份纯属浪费 —— 而一次反应可以产出上百组 结果,每组都复制一遍反应物不是小开销。

§discarded: Vec<Vec<u32>>

discarded[i] = 第 i 个输入分子里没有进入任何产物的原子下标,升序。

这是一条事实记录,不含任何推断:模板明说要删的原子、以及只挂在它们 身上因而失去落脚点的原子,都在这里。产物侧看不到它们,所以不记的话这批 原子就是凭空消失 —— 而“消失“与“被判定为不该存在“是两回事。

把它们收口成分子是另一件事,由 crate::byproduct::reconstruct 做, 而且是推断:模板里没有“离去基团变成了什么“这条信息。两者分开是有意的 —— 本字段永远可信,那边的结论要看它自己给出的档次。

Trait Implementations§

Source§

impl Clone for Outcome

Source§

fn clone(&self) -> Outcome

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Outcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.