Struct dcl_crypto::account::EphemeralPayload
source · pub struct EphemeralPayload {
pub title: String,
pub address: Address,
pub expiration: Expiration,
}
Expand description
An EphemeralPayload
is a message that delegates the right to sign a message to a specific address until an expiration date.
use dcl_crypto::account::{Address, EphemeralPayload, Expiration};
let payload = EphemeralPayload::try_from("Decentraland Login\nEphemeral address: 0xA69ef8104E05325B01A15bA822Be43eF13a2f5d3\nExpiration: 2023-03-30T15:44:55.787Z").unwrap();
let expiration = Expiration::try_from("2023-03-30T15:44:55.787Z").unwrap();
assert_eq!(payload, EphemeralPayload::new(
Address::try_from("0xA69ef8104E05325B01A15bA822Be43eF13a2f5d3").unwrap(),
expiration,
))
Fields§
§title: String
§address: Address
§expiration: Expiration
Implementations§
source§impl EphemeralPayload
impl EphemeralPayload
pub fn new(address: Address, expiration: Expiration) -> Self
pub fn new_with_title( title: String, address: Address, expiration: Expiration ) -> Self
pub fn is_expired(&self) -> bool
pub fn is_expired_at<Z: TimeZone>(&self, time: &DateTime<Z>) -> bool
Trait Implementations§
source§impl Clone for EphemeralPayload
impl Clone for EphemeralPayload
source§fn clone(&self) -> EphemeralPayload
fn clone(&self) -> EphemeralPayload
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for EphemeralPayload
impl Debug for EphemeralPayload
source§impl<'de> Deserialize<'de> for EphemeralPayload
impl<'de> Deserialize<'de> for EphemeralPayload
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for EphemeralPayload
impl Display for EphemeralPayload
source§impl From<EphemeralPayload> for String
impl From<EphemeralPayload> for String
source§fn from(payload: EphemeralPayload) -> Self
fn from(payload: EphemeralPayload) -> Self
Converts to this type from the input type.
source§impl PartialEq for EphemeralPayload
impl PartialEq for EphemeralPayload
source§fn eq(&self, other: &EphemeralPayload) -> bool
fn eq(&self, other: &EphemeralPayload) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for EphemeralPayload
impl Serialize for EphemeralPayload
source§impl TryFrom<&str> for EphemeralPayload
impl TryFrom<&str> for EphemeralPayload
source§impl TryFrom<String> for EphemeralPayload
impl TryFrom<String> for EphemeralPayload
impl StructuralPartialEq for EphemeralPayload
Auto Trait Implementations§
impl RefUnwindSafe for EphemeralPayload
impl Send for EphemeralPayload
impl Sync for EphemeralPayload
impl Unpin for EphemeralPayload
impl UnwindSafe for EphemeralPayload
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