pub struct Order {
pub status: OrderStatus,
pub expires: Option<String>,
pub identifiers: Vec<Identifier>,
pub not_before: Option<String>,
pub not_after: Option<String>,
pub error: Option<ServerError>,
/* private fields */
}
Expand description
An order represents a subscribers’s request for a certificate from the ACME server, and is used to track the progress of that order through to issuance.
This must be created through an OrderBuilder
.
Fields
status: OrderStatus
The status of this order.
expires: Option<String>
The timestamp after which the server will consider this order invalid.
identifiers: Vec<Identifier>
An array of identifier objects that the order pertains to.
not_before: Option<String>
The requested value of the notBefore field in the certificate.
not_after: Option<String>
The requested value of the notAfter field in the certificate.
error: Option<ServerError>
The error that occurred while processing the order, if any.
Implementations
sourceimpl Order
impl Order
Retrieve all of the Authorization
s needed for this order.
The authorization may already be in a Valid
state, if an
authorization for this identifier was already completed through
a seperate order.
sourceimpl Order
impl Order
sourcepub async fn finalize(&self, csr: Csr) -> Result<Order, Error>
pub async fn finalize(&self, csr: Csr) -> Result<Order, Error>
Finalize an order (request the final certificate).
For finalization to complete, the state of the order must be in the
OrderStatus::Ready
state. You can use Order::wait_ready
to wait
until this is the case.
In most cases this will not complete immediately. You should always
call Order::wait_done
after this operation to wait until the
ACME server has finished finalization, and the certificate is ready
for download.
sourcepub async fn certificate(&self) -> Result<Option<Vec<X509>>, Error>
pub async fn certificate(&self) -> Result<Option<Vec<X509>>, Error>
Download the certificate. The order must be in the OrderStatus::Valid
state for this to complete.
sourcepub async fn poll(&self) -> Result<Order, Error>
pub async fn poll(&self) -> Result<Order, Error>
Update the order to match the current server state.
Most users should use Order::wait_ready
or Order::wait_done
.
sourcepub async fn wait_ready(
self,
poll_interval: Duration,
attempts: usize
) -> Result<Order, Error>
pub async fn wait_ready(
self,
poll_interval: Duration,
attempts: usize
) -> Result<Order, Error>
Wait for this order to go into a state other than OrderStatus::Pending
.
This happens when all crate::Authorization
s in this order have been completed
(have the crate::AuthorizationStatus::Valid
state).
Will complete immediately if the order is already in one of these states.
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.
sourcepub async fn wait_done(
self,
poll_interval: Duration,
attempts: usize
) -> Result<Order, Error>
pub async fn wait_done(
self,
poll_interval: Duration,
attempts: usize
) -> Result<Order, Error>
Wait for the order to go into the OrderStatus::Valid
or OrderStatus::Invalid
state.
This will happen after the order has gone into the OrderStatus::Ready
state, and the order has been requested to be finalized.
Will complete immediately if the order is already in one of these states.
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<'de> Deserialize<'de> for Order
impl<'de> Deserialize<'de> for Order
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 Order
impl Send for Order
impl Sync for Order
impl Unpin for Order
impl !UnwindSafe for Order
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