TxIn

Struct TxIn 

Source
pub struct TxIn { /* private fields */ }

Implementations§

Source§

impl TxIn

Platform Agnostic Functions ie. Don’t need Result<T, E>

Source

pub fn new( prev_tx_id: &[u8], vout: u32, script_sig: &Script, sequence: Option<u32>, ) -> TxIn

Source

pub fn default() -> TxIn

Source

pub fn get_prev_tx_id(&self, little_endian: Option<bool>) -> Vec<u8>

Source

pub fn get_prev_tx_id_hex(&self, little_endian: Option<bool>) -> String

Source

pub fn get_vout(&self) -> u32

Source

pub fn get_script_sig_size(&self) -> u64

Source

pub fn get_script_sig(&self) -> Script

Source

pub fn get_script_sig_hex(&self) -> String

Source

pub fn get_sequence(&self) -> u32

Source

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

Source

pub fn get_outpoint_bytes(&self, little_endian: Option<bool>) -> Vec<u8>

Source

pub fn get_outpoint_hex(&self, little_endian: Option<bool>) -> String

Source

pub fn set_script(&mut self, script: &Script)

Source

pub fn set_prev_tx_id(&mut self, txid: &[u8])

Source

pub fn set_vout(&mut self, vout: u32)

Source

pub fn set_sequence(&mut self, sequence: u32)

Source

pub fn set_satoshis(&mut self, satoshis: u64)

Source

pub fn get_satoshis(&self) -> Option<u64>

Source

pub fn set_unlocking_script(&mut self, unlocking_script: &Script)

Source

pub fn get_unlocking_script(&self) -> Option<Script>

Source

pub fn get_unlocking_script_bytes(&self) -> Option<Vec<u8>>

Source§

impl TxIn

Native Specific Functions

Source

pub fn from_hex(hex_str: &str) -> Result<TxIn, BSVErrors>

Source

pub fn to_bytes(&self) -> Result<Vec<u8>, BSVErrors>

Source

pub fn to_hex(&self) -> Result<String, BSVErrors>

Source

pub fn to_compact_bytes(&self) -> Result<Vec<u8>, BSVErrors>

Serialises this entire transaction to CBOR, preserving all fields from the standard Transaction format + XT

Source

pub fn from_compact_bytes(compact_buffer: &[u8]) -> Result<Self, BSVErrors>

Deserialises the provided CBOR buffer to the XT format

Source

pub fn to_compact_hex(&self) -> Result<String, BSVErrors>

Serialises this entire transaction to CBOR Hex, preserving all fields from the standard Transaction format + XT

Source

pub fn from_compact_hex(compact_hex: &str) -> Result<Self, BSVErrors>

Deserialises the provided CBOR hex to the XT format

Source

pub fn to_json_string(&self) -> Result<String, BSVErrors>

Source

pub fn to_json(&self) -> Result<Value, BSVErrors>

Source

pub fn from_outpoint_bytes(outpoint: &[u8]) -> Result<TxIn, BSVErrors>

Source

pub fn get_finalised_script(&self) -> Result<Script, BSVErrors>

Source

pub fn is_coinbase(&self) -> bool

Trait Implementations§

Source§

impl Clone for TxIn

Source§

fn clone(&self) -> TxIn

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TxIn

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TxIn

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TxIn

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TxIn

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for TxIn

Source§

impl StructuralPartialEq for TxIn

Auto Trait Implementations§

§

impl Freeze for TxIn

§

impl RefUnwindSafe for TxIn

§

impl Send for TxIn

§

impl Sync for TxIn

§

impl Unpin for TxIn

§

impl UnwindSafe for TxIn

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,