pub struct WalletMessageHandler {
account_manager: AccountManager,
}
Expand description
The Wallet message handler.
Fields
account_manager: AccountManager
Implementations
sourceimpl WalletMessageHandler
impl WalletMessageHandler
sourcepub async fn new() -> Result<Self>
pub async fn new() -> Result<Self>
Creates a new instance of the message handler with the default account manager.
sourcepub fn with_manager(account_manager: AccountManager) -> Self
pub fn with_manager(account_manager: AccountManager) -> Self
Creates a new instance of the message handler with the specified account manager.
sourcepub async fn listen<F>(&self, events: Vec<WalletEventType>, handler: F) where
F: Fn(&Event) + 'static + Clone + Send + Sync,
pub async fn listen<F>(&self, events: Vec<WalletEventType>, handler: F) where
F: Fn(&Event) + 'static + Clone + Send + Sync,
Listen to wallet events, empty vec will listen to all events
sourcepub async fn clear_listeners(&self, events: Vec<WalletEventType>)
pub async fn clear_listeners(&self, events: Vec<WalletEventType>)
Remove wallet event listeners, empty vec will remove all listeners
sourcepub async fn handle(
&self,
message: Message,
response_tx: UnboundedSender<Response>
)
pub async fn handle(
&self,
message: Message,
response_tx: UnboundedSender<Response>
)
Handles a message.
async fn backup(
&self,
backup_path: PathBuf,
stronghold_password: String
) -> Result<Response>
async fn restore_backup(
&self,
backup_path: PathBuf,
stronghold_password: String
) -> Result<Response>
async fn call_account_method(
&self,
account_id: &AccountIdentifier,
method: AccountMethod
) -> Result<Response>
sourceasync fn create_account(&self, account: &AccountToCreate) -> Result<Response>
async fn create_account(&self, account: &AccountToCreate) -> Result<Response>
The create account message handler.
async fn get_account(&self, account_id: &AccountIdentifier) -> Result<Response>
async fn get_accounts(&self) -> Result<Response>
Auto Trait Implementations
impl !RefUnwindSafe for WalletMessageHandler
impl Send for WalletMessageHandler
impl Sync for WalletMessageHandler
impl Unpin for WalletMessageHandler
impl !UnwindSafe for WalletMessageHandler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more