pub struct SessionStrParams<'a> { /* private fields */ }Expand description
Container for session-related arguments used while constructing a Deploy.
§session_args_simple
For methods taking session_args_simple, this parameter is the session contract arguments, in
the form <NAME:TYPE='VALUE'> or <NAME:TYPE=null>.
There are further details in
the docs for the equivalent
payment_args_simple.
§session_args_json
For methods taking session_args_json, this parameter is the session contract arguments, as a
JSON-encoded Array of JSON Objects of the form:
[{"name":<String>,"type":<VALUE>,"value":<VALUE>}]There are further details in
the docs for the equivalent payment_args_json.
Note while multiple session args can be specified for a single session code instance, only
one of session_args_simple, or session_args_json may be used.
Implementations§
Source§impl<'a> SessionStrParams<'a>
impl<'a> SessionStrParams<'a>
Sourcepub fn with_path(
session_path: &'a str,
session_args_simple: Vec<&'a str>,
session_args_json: &'a str,
) -> Self
pub fn with_path( session_path: &'a str, session_args_simple: Vec<&'a str>, session_args_json: &'a str, ) -> Self
Constructs a SessionStrParams using a session smart contract file.
session_pathis the path to the compiled Wasm session code.- See the struct docs for a description of
session_args_simple,session_args_json
Sourcepub fn with_bytes(
session_bytes: Bytes,
session_args_simple: Vec<&'a str>,
session_args_json: &'a str,
) -> Self
pub fn with_bytes( session_bytes: Bytes, session_args_simple: Vec<&'a str>, session_args_json: &'a str, ) -> Self
Constructs a SessionStrParams using session bytes.
session_bytesare the bytes of the compiled Wasm session code.- See the struct docs for a description of
session_args_simple,session_args_json
Sourcepub fn with_name(
session_name: &'a str,
session_entry_point: &'a str,
session_args_simple: Vec<&'a str>,
session_args_json: &'a str,
) -> Self
pub fn with_name( session_name: &'a str, session_entry_point: &'a str, session_args_simple: Vec<&'a str>, session_args_json: &'a str, ) -> Self
Constructs a SessionStrParams using a stored contract’s name.
session_nameis the name of the stored contract (associated with the executing account) to be called as the session.session_entry_pointis the name of the method that will be used when calling the session contract.- See the struct docs for a description of
session_args_simple,session_args_json
Sourcepub fn with_hash(
session_hash: &'a str,
session_entry_point: &'a str,
session_args_simple: Vec<&'a str>,
session_args_json: &'a str,
) -> Self
pub fn with_hash( session_hash: &'a str, session_entry_point: &'a str, session_args_simple: Vec<&'a str>, session_args_json: &'a str, ) -> Self
Constructs a SessionStrParams using a stored contract’s hex-encoded hash.
session_hashis the hex-encoded hash of the stored contract to be called as the session.session_entry_pointis the name of the method that will be used when calling the session contract.- See the struct docs for a description of
session_args_simple,session_args_json
Sourcepub fn with_package_name(
session_package_name: &'a str,
session_version: &'a str,
session_entry_point: &'a str,
session_args_simple: Vec<&'a str>,
session_args_json: &'a str,
) -> Self
pub fn with_package_name( session_package_name: &'a str, session_version: &'a str, session_entry_point: &'a str, session_args_simple: Vec<&'a str>, session_args_json: &'a str, ) -> Self
Constructs a SessionStrParams using a stored contract’s package name.
session_package_nameis the name of the stored package to be called as the session.session_versionis the version of the called session contract. The latest will be used ifsession_versionis empty.session_entry_pointis the name of the method that will be used when calling the session contract.- See the struct docs for a description of
session_args_simple,session_args_json
Sourcepub fn with_package_hash(
session_package_hash: &'a str,
session_version: &'a str,
session_entry_point: &'a str,
session_args_simple: Vec<&'a str>,
session_args_json: &'a str,
) -> Self
pub fn with_package_hash( session_package_hash: &'a str, session_version: &'a str, session_entry_point: &'a str, session_args_simple: Vec<&'a str>, session_args_json: &'a str, ) -> Self
Constructs a SessionStrParams using a stored contract’s package hash.
session_package_hashis the hex-encoded hash of the stored package to be called as the session.session_versionis the version of the called session contract. The latest will be used ifsession_versionis empty.session_entry_pointis the name of the method that will be used when calling the session contract.- See the struct docs for a description of
session_args_simple,session_args_json
Sourcepub fn with_transfer(
session_args_simple: Vec<&'a str>,
session_args_json: &'a str,
) -> Self
pub fn with_transfer( session_args_simple: Vec<&'a str>, session_args_json: &'a str, ) -> Self
Constructs a SessionStrParams representing a Transfer type of Deploy.
- See the struct docs for a description of
session_args_simple,session_args_json
Trait Implementations§
Source§impl<'a> Debug for SessionStrParams<'a>
impl<'a> Debug for SessionStrParams<'a>
Source§impl<'a> Default for SessionStrParams<'a>
impl<'a> Default for SessionStrParams<'a>
Source§fn default() -> SessionStrParams<'a>
fn default() -> SessionStrParams<'a>
Auto Trait Implementations§
impl<'a> Freeze for SessionStrParams<'a>
impl<'a> RefUnwindSafe for SessionStrParams<'a>
impl<'a> Send for SessionStrParams<'a>
impl<'a> Sync for SessionStrParams<'a>
impl<'a> Unpin for SessionStrParams<'a>
impl<'a> UnwindSafe for SessionStrParams<'a>
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
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>
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>
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