Struct ergo_lib_wasm::box_selector::SimpleBoxSelector [−][src]
Naive box selector, collects inputs until target balance is reached
Implementations
impl SimpleBoxSelector
[src]
pub fn new() -> Self
[src]
Create empty SimpleBoxSelector
pub fn select(
&self,
inputs: &ErgoBoxes,
target_balance: &BoxValue,
target_tokens: &Tokens
) -> Result<BoxSelection, JsValue>
[src]
&self,
inputs: &ErgoBoxes,
target_balance: &BoxValue,
target_tokens: &Tokens
) -> Result<BoxSelection, JsValue>
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.
Trait Implementations
impl FromWasmAbi for SimpleBoxSelector
[src]
type Abi = u32
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: u32) -> Self
[src]
impl IntoWasmAbi for SimpleBoxSelector
[src]
type Abi = u32
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> u32
[src]
impl OptionFromWasmAbi for SimpleBoxSelector
[src]
impl OptionIntoWasmAbi for SimpleBoxSelector
[src]
impl RefFromWasmAbi for SimpleBoxSelector
[src]
type Abi = u32
The wasm ABI type references to Self
are recovered from.
type Anchor = Ref<'static, SimpleBoxSelector>
The type that holds the reference to Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don't persist beyond one function
call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl RefMutFromWasmAbi for SimpleBoxSelector
[src]
type Abi = u32
Same as RefFromWasmAbi::Abi
type Anchor = RefMut<'static, SimpleBoxSelector>
Same as RefFromWasmAbi::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl WasmDescribe for SimpleBoxSelector
[src]
Auto Trait Implementations
impl RefUnwindSafe for SimpleBoxSelector
[src]
impl Send for SimpleBoxSelector
[src]
impl Sync for SimpleBoxSelector
[src]
impl Unpin for SimpleBoxSelector
[src]
impl UnwindSafe for SimpleBoxSelector
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
pub fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
[src]
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]
T: TryExtractFrom<F>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,