pub struct ScriptPublicKey {
pub version: ScriptPublicKeyVersion,
/* private fields */
}Expand description
Represents a Kaspad ScriptPublicKey @category Consensus
Fields§
§version: ScriptPublicKeyVersionImplementations§
Source§impl ScriptPublicKey
impl ScriptPublicKey
pub fn constructor( version: u16, script: JsValue, ) -> Result<ScriptPublicKey, JsError>
pub fn script_as_hex(&self) -> String
Trait Implementations§
Source§impl BorshDeserialize for ScriptPublicKey
impl BorshDeserialize for ScriptPublicKey
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for ScriptPublicKey
impl BorshSerialize for ScriptPublicKey
Source§impl CastFromJs for ScriptPublicKey
impl CastFromJs for ScriptPublicKey
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
JsValueSource§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
JsValuefn 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 ScriptPublicKey
impl Clone for ScriptPublicKey
Source§fn clone(&self) -> ScriptPublicKey
fn clone(&self) -> ScriptPublicKey
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScriptPublicKey
impl Debug for ScriptPublicKey
Source§impl Default for ScriptPublicKey
impl Default for ScriptPublicKey
Source§fn default() -> ScriptPublicKey
fn default() -> ScriptPublicKey
Returns the “default value” for a type. Read more
Source§impl<'de: 'a, 'a> Deserialize<'de> for ScriptPublicKey
impl<'de: 'a, 'a> Deserialize<'de> for ScriptPublicKey
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<ScriptPublicKey> for JsValue
impl From<ScriptPublicKey> for JsValue
Source§fn from(value: ScriptPublicKey) -> Self
fn from(value: ScriptPublicKey) -> Self
Converts to this type from the input type.
Source§impl FromHex for ScriptPublicKey
impl FromHex for ScriptPublicKey
Source§impl FromStr for ScriptPublicKey
impl FromStr for ScriptPublicKey
Source§impl FromWasmAbi for ScriptPublicKey
impl FromWasmAbi for ScriptPublicKey
Source§impl Hash for ScriptPublicKey
impl Hash for ScriptPublicKey
Source§impl IntoWasmAbi for ScriptPublicKey
impl IntoWasmAbi for ScriptPublicKey
Source§impl LongRefFromWasmAbi for ScriptPublicKey
impl LongRefFromWasmAbi for ScriptPublicKey
Source§impl OptionFromWasmAbi for ScriptPublicKey
impl OptionFromWasmAbi for ScriptPublicKey
Source§impl OptionIntoWasmAbi for ScriptPublicKey
impl OptionIntoWasmAbi for ScriptPublicKey
Source§impl PartialEq for ScriptPublicKey
impl PartialEq for ScriptPublicKey
Source§impl RefFromWasmAbi for ScriptPublicKey
impl RefFromWasmAbi for ScriptPublicKey
Source§type Anchor = RcRef<ScriptPublicKey>
type Anchor = RcRef<ScriptPublicKey>
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 ScriptPublicKey
impl RefMutFromWasmAbi for ScriptPublicKey
Source§impl Serialize for ScriptPublicKey
impl Serialize for ScriptPublicKey
Source§impl TryCastFromJs for ScriptPublicKey
impl TryCastFromJs for ScriptPublicKey
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 ScriptPublicKey
impl TryFromJsValue for ScriptPublicKey
Source§impl VectorFromWasmAbi for ScriptPublicKey
impl VectorFromWasmAbi for ScriptPublicKey
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[ScriptPublicKey]>
Source§impl VectorIntoWasmAbi for ScriptPublicKey
impl VectorIntoWasmAbi for ScriptPublicKey
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[ScriptPublicKey]>) -> Self::Abi
Source§impl WasmDescribeVector for ScriptPublicKey
impl WasmDescribeVector for ScriptPublicKey
impl Eq for ScriptPublicKey
impl StructuralPartialEq for ScriptPublicKey
impl SupportsConstructor for ScriptPublicKey
impl SupportsInstanceProperty for ScriptPublicKey
impl SupportsStaticProperty for ScriptPublicKey
Auto Trait Implementations§
impl Freeze for ScriptPublicKey
impl RefUnwindSafe for ScriptPublicKey
impl Send for ScriptPublicKey
impl Sync for ScriptPublicKey
impl Unpin for ScriptPublicKey
impl UnwindSafe for ScriptPublicKey
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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::AbiSource§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.