pub struct ScriptNum { /* private fields */ }
Expand description

Implementations§

source§

impl ScriptNum

source

pub fn assign_from(&mut self, rhs: &i64) -> &mut ScriptNum

source§

impl ScriptNum

source

pub fn new( vch: &Vec<u8>, require_minimal: bool, n_max_num_size: Option<usize> ) -> Self

source

pub fn getint(&self) -> i32

source

pub fn getvch(&self) -> Vec<u8>

source

pub fn serialize(value: &i64) -> Vec<u8>

source

pub fn set_vch(vch: &Vec<u8>) -> i64

Trait Implementations§

source§

impl Add<&ScriptNum> for ScriptNum

§

type Output = ScriptNum

The resulting type after applying the + operator.
source§

fn add(self, other: &ScriptNum) -> Self::Output

Performs the + operation. Read more
source§

impl Add<i64> for ScriptNum

§

type Output = ScriptNum

The resulting type after applying the + operator.
source§

fn add(self, other: i64) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign<&ScriptNum> for ScriptNum

source§

fn add_assign(&mut self, other: &ScriptNum)

Performs the += operation. Read more
source§

impl AddAssign<i64> for ScriptNum

source§

fn add_assign(&mut self, other: i64)

Performs the += operation. Read more
source§

impl BitAnd<&ScriptNum> for ScriptNum

§

type Output = ScriptNum

The resulting type after applying the & operator.
source§

fn bitand(self, other: &ScriptNum) -> Self::Output

Performs the & operation. Read more
source§

impl BitAnd<i64> for ScriptNum

§

type Output = ScriptNum

The resulting type after applying the & operator.
source§

fn bitand(self, other: i64) -> Self::Output

Performs the & operation. Read more
source§

impl BitAndAssign<&ScriptNum> for ScriptNum

source§

fn bitand_assign(&mut self, rhs: &ScriptNum)

Performs the &= operation. Read more
source§

impl BitAndAssign<i64> for ScriptNum

source§

fn bitand_assign(&mut self, rhs: i64)

Performs the &= operation. Read more
source§

impl From<&ScriptNum> for Script

source§

fn from(b: &ScriptNum) -> Self

Converts to this type from the input type.
source§

impl From<i64> for ScriptNum

source§

fn from(n: i64) -> Self

| Numeric opcodes (OP_1ADD, etc) are | restricted to operating on 4-byte integers. | | The semantics are subtle, though: operands | must be in the range [-2^31 +1…2^31 -1], | but results may overflow (and are valid as | long as they are not used in a subsequent | numeric operation). | | CScriptNum enforces those semantics by | storing results as an int64 and allowing | out-of-range values to be returned as | a vector of bytes but throwing an | exception if arithmetic is done or the | result is interpreted as an integer. |

source§

impl Neg for ScriptNum

§

type Output = ScriptNum

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Ord for ScriptNum

source§

fn cmp(&self, other: &ScriptNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ScriptNum> for ScriptNum

source§

fn eq(&self, other: &ScriptNum) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i64> for ScriptNum

source§

fn eq(&self, other: &i64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ScriptNum> for ScriptNum

source§

fn partial_cmp(&self, other: &ScriptNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<i64> for ScriptNum

source§

fn partial_cmp(&self, other: &i64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Shl<&ScriptNum> for Script

§

type Output = Script

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &ScriptNum) -> Self::Output

Performs the << operation. Read more
source§

impl Sub<&ScriptNum> for ScriptNum

§

type Output = ScriptNum

The resulting type after applying the - operator.
source§

fn sub(self, other: &ScriptNum) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<i64> for ScriptNum

§

type Output = ScriptNum

The resulting type after applying the - operator.
source§

fn sub(self, other: i64) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign<&ScriptNum> for ScriptNum

source§

fn sub_assign(&mut self, other: &ScriptNum)

Performs the -= operation. Read more
source§

impl SubAssign<i64> for ScriptNum

source§

fn sub_assign(&mut self, other: i64)

Performs the -= operation. Read more
source§

impl Eq for ScriptNum

Auto Trait Implementations§

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
§

impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,

§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> StaticUpcast<T> for T

§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
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.
§

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

§

fn vzip(self) -> V