pub struct Intent {
pub scope: IntentScope,
pub version: IntentVersion,
pub app_id: IntentAppId,
}
Expand description
A Signing Intent
An intent is a compact struct serves as the domain separator for a message that a signature commits to. It consists of three parts: 1. [enum IntentScope] (what the type of the message is) 2. [enum IntentVersion] 3. [enum AppId] (what application that the signature refers to).
The serialization of an Intent is a 3-byte array where each field is represented by a byte and it is prepended onto a message before it is signed in Sui.
Fields§
§scope: IntentScope
§version: IntentVersion
§app_id: IntentAppId
Implementations§
source§impl Intent
impl Intent
pub fn new( scope: IntentScope, version: IntentVersion, app_id: IntentAppId, ) -> Self
pub fn to_bytes(self) -> [u8; 3]
pub fn scope(self) -> IntentScope
pub fn version(self) -> IntentVersion
pub fn app_id(self) -> IntentAppId
Trait Implementations§
impl Copy for Intent
impl Eq for Intent
impl StructuralPartialEq for Intent
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnwindSafe for Intent
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)