ZeroEquation in lib - Rust
Description: ZeroEquation is an equation with a list of values on one side and a solution on the other. Similar to Equation, but with a list of values (in a Vec) that will add up to the solution (or be subtracted if the number is negative). Sol is set to 0 and values can be moved to the solution side of the equation with move_to_sol().

# Struct lib::ZeroEquation

source ·

    pub struct ZeroEquation { /* private fields */ }

Expand description

ZeroEquation is an equation with a list of values on one side and a solution on the other. Similar to Equation, but with a list of values (in a Vec) that will add up to the solution (or be subtracted if the number is negative). Sol is set to 0 and values can be moved to the solution side of the equation with move_to_sol().

## Example

## Implementations§

source§

### impl ZeroEquation

source

#### pub fn new(values: Vec<i128>) -> ZeroEquation

source

#### pub fn get_values(&self) -> Vec<i128>

source

#### pub fn get_value(&self, index: usize) -> i128

source

#### pub fn add_value(&mut self, value: i128)

source

#### pub fn remove_value(&mut self, index: usize)

source

#### pub fn get_sol(&self) -> i128

source

#### pub fn move_to_sol(&mut self, index: usize) -> i128

source

#### pub fn is_valid(&mut self) -> bool

source

#### pub fn get_error(&mut self) -> i128

## Auto Trait Implementations§

§

### impl RefUnwindSafe for ZeroEquation

§

### impl Send for ZeroEquation

§

### impl Sync for ZeroEquation

§

### impl Unpin for ZeroEquation

§

### impl UnwindSafe for ZeroEquation

## Blanket Implementations§

source§

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

source§

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
source§

### impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

### impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

### impl<T> From<T> for T

const: unstable · source§

#### fn from(t: T) -> T

Returns the argument unchanged.

source§

### impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

#### type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

### impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.