pub struct Session { /* private fields */ }Expand description
A session with the Wallet Bridge.
Implementations§
Source§impl Session
impl Session
Sourcepub async fn new<V: SolValue + Send>(
app_id: &AppId,
action: &str,
verification_level: VerificationLevel,
bridge_url: BridgeUrl,
signal: V,
action_description: Option<&str>,
) -> Result<Self, Error>
pub async fn new<V: SolValue + Send>( app_id: &AppId, action: &str, verification_level: VerificationLevel, bridge_url: BridgeUrl, signal: V, action_description: Option<&str>, ) -> Result<Self, Error>
Create a new session with the Wallet Bridge.
§Errors
Returns an error if the request to the bridge fails, or if the response from the bridge is malformed.
Sourcepub fn connect_url(&self) -> Url
pub fn connect_url(&self) -> Url
Returns the URL that the user should be directed to in order to connect their World App to the client.
Sourcepub async fn poll_for_status(&self) -> Result<Status, Error>
pub async fn poll_for_status(&self) -> Result<Status, Error>
Polls the bridge for the status of the request, and returns the current status.
You should call this method repeatedly until it returns Status::Confirmed or Status::Failed. Calling it again after leads to undefined behaviour.
§Errors
Returns an error if the request to the bridge fails, or if the response from the bridge is malformed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl !UnwindSafe for Session
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