pub struct Handler<'a, T> { /* fields omitted */ }
A handler which store the equation and other information
Create a Handler
by given equation
Parse and balance the equation. If it has been parsed, then just balance it.
If the equation can balance, function would return Ok((ChemicalEquation, Vec<Vec<T>>))
which contains the answer.
If not, it would return Err(ErrorCases)
which contains the failure.
- A large number (bigger than
usize::MAX
) of formula may cause panic. Because it is using Vec
.
And in the other failed situation, it'll return ErrorCases
.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<SS, SP> SupersetOf for SP where SS: SubsetOf<SP>, | |
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.