Struct instant_acme::Account
source · pub struct Account { /* private fields */ }
Expand description
An ACME account as described in RFC 8555 (section 7.1.2)
Create an Account
with Account::create()
or restore it from serialized data
by passing deserialized AccountCredentials
to Account::from_credentials()
.
The Account
type is cheap to clone.
Implementations
sourceimpl Account
impl Account
sourcepub fn from_credentials(
credentials: AccountCredentials<'_>
) -> Result<Self, Error>
pub fn from_credentials(
credentials: AccountCredentials<'_>
) -> Result<Self, Error>
Restore an existing account from the given credentials
The AccountCredentials
type is opaque, but supports deserialization.
sourcepub async fn create(
account: &NewAccount<'_>,
server_url: &str
) -> Result<Account, Error>
pub async fn create(
account: &NewAccount<'_>,
server_url: &str
) -> Result<Account, Error>
Create a new account on the server_url
with the information in NewAccount
sourcepub async fn new_order<'a>(
&'a self,
order: &NewOrder<'_>
) -> Result<(Order, OrderState), Error>
pub async fn new_order<'a>(
&'a self,
order: &NewOrder<'_>
) -> Result<(Order, OrderState), Error>
Create a new order based on the given NewOrder
Returns both an Order
instance and the initial OrderState
.
sourcepub fn credentials(&self) -> AccountCredentials<'_>
pub fn credentials(&self) -> AccountCredentials<'_>
Get the account’s credentials, which can be serialized
Pass the credentials to Account::from_credentials
to regain access to the Account
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl !UnwindSafe for Account
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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