Struct acme2::Authorization
source · [−]pub struct Authorization {
pub identifier: Identifier,
pub status: AuthorizationStatus,
pub expires: Option<String>,
pub challenges: Vec<Challenge>,
pub wildcard: Option<bool>,
/* private fields */
}
Expand description
An autorization represents the server’s authorization of a certain domain being represented by an account.
Fields
identifier: Identifier
The identifier (domain) that the account is authorized to represent.
status: AuthorizationStatus
The status of this authorization.
expires: Option<String>
The timestamp after which the server will consider this authorization invalid.
challenges: Vec<Challenge>
For pending authorizations, the challenges that the client can fulfill in order to prove possession of the identifier. For valid authorizations, the challenge that was validated. For invalid authorizations, the challenge that was attempted and failed.
wildcard: Option<bool>
Whether this authorization was created for a wildcard identifier (domain).
Implementations
sourceimpl Authorization
impl Authorization
sourcepub fn get_challenge(&self, type: &str) -> Option<Challenge>
pub fn get_challenge(&self, type: &str) -> Option<Challenge>
Get a certain type of challenge to complete.
Example: http-01
, or dns-01
sourcepub async fn poll(self) -> Result<Authorization, Error>
pub async fn poll(self) -> Result<Authorization, Error>
Update the authorization to match the current server state.
Most users should use Authorization::wait_done
.
sourcepub async fn wait_done(
self,
poll_interval: Duration,
attempts: usize
) -> Result<Authorization, Error>
pub async fn wait_done(
self,
poll_interval: Duration,
attempts: usize
) -> Result<Authorization, Error>
Wait for the authorization to go into a state other than
AuthorizationStatus::Pending
.
This will only happen once one of the challenges in an authorization
is completed. You can use Challenge::wait_done
to wait until
this is the case.
Will complete immediately if the authorization is already in a
state other than AuthorizationStatus::Pending
.
Specify the interval at which to poll the acme server, and how often to attempt polling before timing out. Polling should not happen faster than about every 5 seconds to avoid rate limits in the acme server.
Trait Implementations
sourceimpl Debug for Authorization
impl Debug for Authorization
sourceimpl<'de> Deserialize<'de> for Authorization
impl<'de> Deserialize<'de> for Authorization
sourcefn 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
Auto Trait Implementations
impl !RefUnwindSafe for Authorization
impl Send for Authorization
impl Sync for Authorization
impl Unpin for Authorization
impl !UnwindSafe for Authorization
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more