Struct ergo_lib::wallet::box_selector::SimpleBoxSelector[][src]

pub struct SimpleBoxSelector {}
Expand description

Simple box selector, collects inputs(sorted by targeted assets) until target balance is reached

Implementations

impl SimpleBoxSelector[src]

pub fn new() -> Self[src]

Create new boxed instance

Trait Implementations

impl<T: ErgoBoxAssets> BoxSelector<T> for SimpleBoxSelector[src]

fn select(
    &self,
    inputs: Vec<T>,
    target_balance: BoxValue,
    target_tokens: &[Token]
) -> Result<BoxSelection<T>, BoxSelectorError>
[src]

Selects inputs to satisfy target balance and tokens. inputs - available inputs (returns an error, if empty), target_balance - coins (in nanoERGs) needed, target_tokens - amount of tokens needed. Returns selected inputs and box assets(value+tokens) with change.

impl Default for SimpleBoxSelector[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<F> TryExtractInto<F> for F[src]

pub fn try_extract_into<T>(self) -> Result<T, TryExtractFromError> where
    T: TryExtractFrom<F>, 
[src]

Extract value of the given type from any type (e.g. [‘Constant’], super::value::Value) on which TryExtractFrom is implemented Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V