solana_sdk::signer::signers

Trait Signers

Source
pub trait Signers {
    // Required methods
    fn pubkeys(&self) -> Vec<Pubkey>;
    fn try_pubkeys(&self) -> Result<Vec<Pubkey>, SignerError>;
    fn sign_message(&self, message: &[u8]) -> Vec<Signature>;
    fn try_sign_message(
        &self,
        message: &[u8],
    ) -> Result<Vec<Signature>, SignerError>;
    fn is_interactive(&self) -> bool;
}
Expand description

Convenience trait for working with mixed collections of Signers

Required Methods§

Source

fn pubkeys(&self) -> Vec<Pubkey>

Source

fn try_pubkeys(&self) -> Result<Vec<Pubkey>, SignerError>

Source

fn sign_message(&self, message: &[u8]) -> Vec<Signature>

Source

fn try_sign_message( &self, message: &[u8], ) -> Result<Vec<Signature>, SignerError>

Source

fn is_interactive(&self) -> bool

Implementors§

Source§

impl<T: ?Sized, S: Signer + ?Sized> Signers for T
where for<'a> &'a T: IntoIterator<Item = &'a S>,

Any T where T impls IntoIterator yielding Signers implements Signers.

This includes [&dyn Signer], [Box<dyn Signer>], [&dyn Signer; N], Vec<dyn Signer>, Vec<Keypair>, etc.

When used as a generic function param, &T should be used instead of T where T: Signers, due to the ?Sized bounds on T. E.g. Signer implements Signers, but &[Signer] does not