pub enum Signer {
AccountSigner(AccountSigner),
ContractSigner(ContractSigner),
TransactionSigner(TransactionSigner),
}
Expand description
Represents a signer in the NEO blockchain.
This enum can be either an AccountSigner
, ContractSigner
, or TransactionSigner
.
Variants§
Implementations§
Source§impl Signer
impl Signer
Sourcepub fn from_bytes(data: &[u8]) -> Result<Signer, TransactionError>
pub fn from_bytes(data: &[u8]) -> Result<Signer, TransactionError>
Sourcepub fn get_type(&self) -> SignerType
pub fn get_type(&self) -> SignerType
Returns the type of the signer.
Sourcepub fn get_signer_hash(&self) -> &H160
pub fn get_signer_hash(&self) -> &H160
Returns a reference to the signer’s script hash.
pub fn as_account_signer(&self) -> Option<&AccountSigner>
pub fn as_contract_signer(&self) -> Option<&ContractSigner>
pub fn as_transaction_signer(&self) -> Option<&TransactionSigner>
Sourcepub fn to_account_signer(self) -> Result<AccountSigner, String>
pub fn to_account_signer(self) -> Result<AccountSigner, String>
Safely converts to AccountSigner
Sourcepub fn to_contract_signer(self) -> Result<ContractSigner, String>
pub fn to_contract_signer(self) -> Result<ContractSigner, String>
Safely converts to ContractSigner
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Signer
impl<'de> Deserialize<'de> for Signer
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<AccountSigner> for Signer
impl From<AccountSigner> for Signer
Source§fn from(account_signer: AccountSigner) -> Self
fn from(account_signer: AccountSigner) -> Self
Converts to this type from the input type.
Source§impl From<ContractSigner> for Signer
impl From<ContractSigner> for Signer
Source§fn from(contract_signer: ContractSigner) -> Self
fn from(contract_signer: ContractSigner) -> Self
Converts to this type from the input type.
Source§impl Into<AccountSigner> for Signer
impl Into<AccountSigner> for Signer
Source§fn into(self) -> AccountSigner
fn into(self) -> AccountSigner
Converts this type into the (usually inferred) input type.
Source§impl Into<ContractSigner> for &mut Signer
impl Into<ContractSigner> for &mut Signer
Source§fn into(self) -> ContractSigner
fn into(self) -> ContractSigner
Converts this type into the (usually inferred) input type.
Source§impl Into<ContractSigner> for Signer
impl Into<ContractSigner> for Signer
Source§fn into(self) -> ContractSigner
fn into(self) -> ContractSigner
Converts this type into the (usually inferred) input type.
Source§impl Into<TransactionSigner> for &Signer
impl Into<TransactionSigner> for &Signer
Source§fn into(self) -> TransactionSigner
fn into(self) -> TransactionSigner
Converts this type into the (usually inferred) input type.
Source§impl Into<TransactionSigner> for &mut Signer
impl Into<TransactionSigner> for &mut Signer
Source§fn into(self) -> TransactionSigner
fn into(self) -> TransactionSigner
Converts this type into the (usually inferred) input type.
Source§impl Into<TransactionSigner> for Signer
impl Into<TransactionSigner> for Signer
Source§fn into(self) -> TransactionSigner
fn into(self) -> TransactionSigner
Converts this type into the (usually inferred) input type.
Source§impl NeoSerializable for Signer
impl NeoSerializable for Signer
Source§impl Serialize for Signer
impl Serialize for Signer
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl SignerTrait for Signer
impl SignerTrait for Signer
fn get_type(&self) -> SignerType
fn get_signer_hash(&self) -> &H160
fn set_signer_hash(&mut self, signer_hash: H160)
fn get_scopes(&self) -> &Vec<WitnessScope>
fn get_scopes_mut(&mut self) -> &mut Vec<WitnessScope>
fn set_scopes(&mut self, scopes: Vec<WitnessScope>)
fn get_allowed_contracts(&self) -> &Vec<H160>
fn get_allowed_contracts_mut(&mut self) -> &mut Vec<H160>
fn get_allowed_groups(&self) -> &Vec<Secp256r1PublicKey>
fn get_allowed_groups_mut(&mut self) -> &mut Vec<Secp256r1PublicKey>
fn get_rules(&self) -> &Vec<WitnessRule>
fn get_rules_mut(&mut self) -> &mut Vec<WitnessRule>
fn set_allowed_contracts( &mut self, contracts: Vec<H160>, ) -> Result<(), BuilderError>
fn set_allowed_groups( &mut self, groups: Vec<Secp256r1PublicKey>, ) -> Result<(), BuilderError>
fn set_rules( &mut self, rules: Vec<WitnessRule>, ) -> Result<&mut Self, BuilderError>
fn check_depth( &self, condition: &WitnessCondition, depth: i8, ) -> Result<(), BuilderError>
fn validate_subitems( &self, count: usize, _name: &str, ) -> Result<(), BuilderError>
Auto Trait Implementations§
impl Freeze for Signer
impl RefUnwindSafe for Signer
impl Send for Signer
impl Sync for Signer
impl Unpin for Signer
impl UnwindSafe for Signer
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<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