pub struct TransactionInput { /* private fields */ }
Expand description
Represents a Kaspa transaction input @category Consensus
Implementations§
Source§impl TransactionInput
impl TransactionInput
pub fn new( previous_outpoint: TransactionOutpoint, signature_script: Option<Vec<u8>>, sequence: u64, sig_op_count: u8, utxo: Option<UtxoEntryReference>, ) -> Self
pub fn new_with_inner(inner: TransactionInputInner) -> Self
pub fn inner(&self) -> MutexGuard<'_, TransactionInputInner>
pub fn sig_op_count(&self) -> u8
pub fn signature_script_length(&self) -> usize
pub fn utxo(&self) -> Option<UtxoEntryReference>
Source§impl TransactionInput
impl TransactionInput
pub fn constructor(value: &TransactionInputT) -> Result<TransactionInput>
pub fn get_previous_outpoint(&self) -> TransactionOutpoint
pub fn set_previous_outpoint(&mut self, js_value: &JsValue) -> Result<()>
pub fn get_signature_script_as_hex(&self) -> Option<String>
pub fn set_signature_script_from_js_value( &mut self, js_value: JsValue, ) -> Result<()>
pub fn get_sequence(&self) -> u64
pub fn set_sequence(&mut self, sequence: u64)
pub fn get_sig_op_count(&self) -> u8
pub fn set_sig_op_count(&mut self, sig_op_count: u8)
pub fn get_utxo(&self) -> Option<UtxoEntryReference>
Source§impl TransactionInput
impl TransactionInput
pub fn set_signature_script(&self, signature_script: Vec<u8>)
pub fn script_public_key(&self) -> Option<ScriptPublicKey>
Trait Implementations§
Source§impl AsRef<TransactionInput> for TransactionInput
impl AsRef<TransactionInput> for TransactionInput
Source§fn as_ref(&self) -> &TransactionInput
fn as_ref(&self) -> &TransactionInput
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl CastFromJs for TransactionInput
impl CastFromJs for TransactionInput
Source§fn try_ref_from_js_value<'a, R>(
js: &'a R,
) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>
fn try_ref_from_js_value<'a, R>( js: &'a R, ) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>
Obtain safe reference from
JsValue
Source§fn try_long_ref_from_js_value<'a, R>(
js: &'a R,
) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>
fn try_long_ref_from_js_value<'a, R>( js: &'a R, ) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>
Obtain safe long reference from
JsValue
fn try_ref_from_js_value_as_cast<'a, R>( js_value: &'a R, ) -> Result<Cast<'a, Self>, Error>
fn try_long_ref_from_js_value_as_cast<'a, R>( js: &'a R, ) -> Result<Cast<'a, Self>, Error>
Source§impl Clone for TransactionInput
impl Clone for TransactionInput
Source§fn clone(&self) -> TransactionInput
fn clone(&self) -> TransactionInput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TransactionInput
impl Debug for TransactionInput
Source§impl<'de> Deserialize<'de> for TransactionInput
impl<'de> Deserialize<'de> for TransactionInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 From<&TransactionInput> for TransactionInput
impl From<&TransactionInput> for TransactionInput
Source§fn from(tx_input: &TransactionInput) -> Self
fn from(tx_input: &TransactionInput) -> Self
Converts to this type from the input type.
Source§impl From<TransactionInput> for JsValue
impl From<TransactionInput> for JsValue
Source§fn from(value: TransactionInput) -> Self
fn from(value: TransactionInput) -> Self
Converts to this type from the input type.
Source§impl From<TransactionInput> for TransactionInput
impl From<TransactionInput> for TransactionInput
Source§fn from(tx_input: TransactionInput) -> Self
fn from(tx_input: TransactionInput) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for TransactionInput
impl FromWasmAbi for TransactionInput
Source§impl IntoWasmAbi for TransactionInput
impl IntoWasmAbi for TransactionInput
Source§impl OptionFromWasmAbi for TransactionInput
impl OptionFromWasmAbi for TransactionInput
Source§impl OptionIntoWasmAbi for TransactionInput
impl OptionIntoWasmAbi for TransactionInput
Source§impl RefFromWasmAbi for TransactionInput
impl RefFromWasmAbi for TransactionInput
Source§type Anchor = RcRef<TransactionInput>
type Anchor = RcRef<TransactionInput>
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.Source§impl RefMutFromWasmAbi for TransactionInput
impl RefMutFromWasmAbi for TransactionInput
Source§impl Serialize for TransactionInput
impl Serialize for TransactionInput
Source§impl TryCastFromJs for TransactionInput
impl TryCastFromJs for TransactionInput
type Error = Error
Source§fn try_cast_from<'a, R>(value: &'a R) -> Result<Cast<'_, Self>, Self::Error>
fn try_cast_from<'a, R>(value: &'a R) -> Result<Cast<'_, Self>, Self::Error>
Try to cast a JsValue into a Rust object.
This should be user-defined function that
attempts to cast a JsValue into a Rust object
or interpret a source data and create a
temporary struct owned by by the
Cast
.Source§fn try_owned_from(value: impl AsRef<JsValue>) -> Result<Self, Self::Error>
fn try_owned_from(value: impl AsRef<JsValue>) -> Result<Self, Self::Error>
Perform a user cast and consume the
Cast
container.
This function will return a temporary user-created
object created during [try_cast_from
] or a clone of the casted reference.fn try_captured_cast_from( js_value: impl AsRef<JsValue>, ) -> Result<Cast<'static, Self>, Self::Error>
Source§fn resolve<'a, R>(
js: &'a R,
create: impl FnOnce() -> Result<Self, Self::Error>,
) -> Result<Cast<'a, Self>, Self::Error>
fn resolve<'a, R>( js: &'a R, create: impl FnOnce() -> Result<Self, Self::Error>, ) -> Result<Cast<'a, Self>, Self::Error>
Try to cast a JsValue into a Rust object, in cast of failure
invoke a user-supplied closure that can try to create an instance
of the object based on the supplied JsValue.
Source§fn resolve_cast<'a, R>(
js: &'a R,
create: impl FnOnce() -> Result<Cast<'a, Self>, Self::Error>,
) -> Result<Cast<'a, Self>, Self::Error>
fn resolve_cast<'a, R>( js: &'a R, create: impl FnOnce() -> Result<Cast<'a, Self>, Self::Error>, ) -> Result<Cast<'a, Self>, Self::Error>
Try to cast a JsValue into a Rust object, in cast of failure
invoke a user-supplied closure that can try to create an instance
of the object based on the supplied JsValue. Unlike the [
resolve
]
function, this function expects create
closure to return a Cast
.
This is useful when routing the creation of the object to another
function that is capable of creating a compatible Cast wrapper.Source§impl TryFromJsValue for TransactionInput
impl TryFromJsValue for TransactionInput
Source§impl VectorFromWasmAbi for TransactionInput
impl VectorFromWasmAbi for TransactionInput
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[TransactionInput]>
Source§impl VectorIntoJsValue for TransactionInput
impl VectorIntoJsValue for TransactionInput
fn vector_into_jsvalue(vector: Box<[TransactionInput]>) -> JsValue
Source§impl VectorIntoWasmAbi for TransactionInput
impl VectorIntoWasmAbi for TransactionInput
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[TransactionInput]>) -> Self::Abi
Source§impl WasmDescribeVector for TransactionInput
impl WasmDescribeVector for TransactionInput
impl SupportsConstructor for TransactionInput
impl SupportsInstanceProperty for TransactionInput
impl SupportsStaticProperty for TransactionInput
Auto Trait Implementations§
impl Freeze for TransactionInput
impl RefUnwindSafe for TransactionInput
impl Send for TransactionInput
impl Sync for TransactionInput
impl Unpin for TransactionInput
impl UnwindSafe for TransactionInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.