pub struct ContractParameter {
pub value: Option<ParameterValue>,
/* private fields */
}
Fields§
§value: Option<ParameterValue>
Implementations§
Source§impl ContractParameter
impl ContractParameter
Sourcepub fn as_public_key(&self) -> Result<Secp256r1PublicKey, String>
pub fn as_public_key(&self) -> Result<Secp256r1PublicKey, String>
Safely extracts a public key from the parameter
Source§impl ContractParameter
impl ContractParameter
pub fn new(typ: ContractParameterType) -> Self
pub fn get_type(&self) -> ContractParameterType
pub fn with_value(typ: ContractParameterType, value: ParameterValue) -> Self
pub fn bool(value: bool) -> Self
pub fn to_bool(&self) -> Result<bool, String>
pub fn integer(value: i64) -> Self
pub fn to_integer(&self) -> Result<i64, String>
pub fn byte_array(value: Vec<u8>) -> Self
pub fn to_byte_array(&self) -> Result<Vec<u8>, String>
pub fn string(value: String) -> Self
pub fn to_string(&self) -> Result<String, String>
pub fn h160(value: &H160) -> Self
pub fn to_h160(&self) -> Result<H160, String>
pub fn h256(value: &H256) -> Self
pub fn to_h256(&self) -> Result<H256, String>
pub fn public_key(value: &Secp256r1PublicKey) -> Self
pub fn to_public_key(&self) -> Result<Secp256r1PublicKey, String>
pub fn signature(value: &str) -> Self
pub fn to_signature(&self) -> Result<String, String>
pub fn array(values: Vec<Self>) -> Self
pub fn to_array(&self) -> Result<Vec<ContractParameter>, String>
pub fn map(values: ContractParameterMap) -> Self
pub fn to_map(&self) -> Result<ContractParameterMap, String>
pub fn any() -> Self
pub fn hash(self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for ContractParameter
impl Clone for ContractParameter
Source§fn clone(&self) -> ContractParameter
fn clone(&self) -> ContractParameter
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ContractParameter
impl Debug for ContractParameter
Source§impl<'de> Deserialize<'de> for ContractParameter
impl<'de> Deserialize<'de> for ContractParameter
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<&[u8]> for ContractParameter
impl From<&[u8]> for ContractParameter
Source§impl From<&H160> for ContractParameter
impl From<&H160> for ContractParameter
Source§impl From<&H256> for ContractParameter
impl From<&H256> for ContractParameter
Source§impl From<&NefFile> for ContractParameter
impl From<&NefFile> for ContractParameter
Source§impl From<&Role> for ContractParameter
impl From<&Role> for ContractParameter
Source§impl From<&Secp256r1PublicKey> for ContractParameter
impl From<&Secp256r1PublicKey> for ContractParameter
Source§fn from(value: &Secp256r1PublicKey) -> Self
fn from(value: &Secp256r1PublicKey) -> Self
Converts to this type from the input type.
Source§impl From<&String> for ContractParameter
impl From<&String> for ContractParameter
Source§impl From<&Vec<ContractParameter>> for ContractParameter
impl From<&Vec<ContractParameter>> for ContractParameter
Source§fn from(value: &Vec<ContractParameter>) -> Self
fn from(value: &Vec<ContractParameter>) -> Self
Converts to this type from the input type.
Source§impl From<&str> for ContractParameter
impl From<&str> for ContractParameter
Source§impl From<H160> for ContractParameter
impl From<H160> for ContractParameter
Source§impl From<NNSName> for ContractParameter
impl From<NNSName> for ContractParameter
Source§impl From<String> for ContractParameter
impl From<String> for ContractParameter
Source§impl From<Value> for ContractParameter
impl From<Value> for ContractParameter
Source§impl From<bool> for ContractParameter
impl From<bool> for ContractParameter
Source§impl From<i32> for ContractParameter
impl From<i32> for ContractParameter
Source§impl From<u32> for ContractParameter
impl From<u32> for ContractParameter
Source§impl From<u64> for ContractParameter
impl From<u64> for ContractParameter
Source§impl From<u8> for ContractParameter
impl From<u8> for ContractParameter
Source§impl From<usize> for ContractParameter
impl From<usize> for ContractParameter
Source§impl Hash for ContractParameter
impl Hash for ContractParameter
Source§impl Into<ContractParameter> for NefFile
impl Into<ContractParameter> for NefFile
Source§fn into(self) -> ContractParameter
fn into(self) -> ContractParameter
Converts this type into the (usually inferred) input type.
Source§impl Into<ContractParameter> for Role
impl Into<ContractParameter> for Role
Source§fn into(self) -> ContractParameter
fn into(self) -> ContractParameter
Converts this type into the (usually inferred) input type.
Source§impl Into<Value> for ContractParameter
impl Into<Value> for ContractParameter
Source§impl PartialEq for ContractParameter
impl PartialEq for ContractParameter
Source§impl Serialize for ContractParameter
impl Serialize for ContractParameter
Source§impl ValueExtension for ContractParameter
impl ValueExtension for ContractParameter
impl Eq for ContractParameter
impl StructuralPartialEq for ContractParameter
Auto Trait Implementations§
impl Freeze for ContractParameter
impl RefUnwindSafe for ContractParameter
impl Send for ContractParameter
impl Sync for ContractParameter
impl Unpin for ContractParameter
impl UnwindSafe for ContractParameter
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more