pub trait AcmeCache {
type Error: CacheError;
// Required methods
fn read_account<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
contacts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn write_account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
contacts: &'life1 [&'life2 str],
data: &'life3 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn write_certificate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
domains: &'life1 [String],
directory_url: &'life2 str,
key_pem: &'life3 str,
certificate_pem: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
}Expand description
Trait to define a custom location/mechanism to cache account data and certificates.
Required Associated Types§
Sourcetype Error: CacheError
type Error: CacheError
The error type returned from the functions on this trait.
Required Methods§
Sourcefn read_account<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
contacts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read_account<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
contacts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns the previously written data for contacts, if any. This
function should return None instead of erroring if data was not
previously written for contacts.
Sourcefn write_account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
contacts: &'life1 [&'life2 str],
data: &'life3 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn write_account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
contacts: &'life1 [&'life2 str],
data: &'life3 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Writes data for contacts. The data being written is unique for the
combined list of contacts.
§Errors
Returns an error when data was unable to be written successfully.
Sourcefn write_certificate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
domains: &'life1 [String],
directory_url: &'life2 str,
key_pem: &'life3 str,
certificate_pem: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn write_certificate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
domains: &'life1 [String],
directory_url: &'life2 str,
key_pem: &'life3 str,
certificate_pem: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Writes a certificate retrieved from Acme. The parameters are:
§Parameters
domains: the list of domains included in the certificate.directory_url: the Url of theAcmedirectory that this certificate was issued form.key_pem: the private key, encoded in PEM format.certificate_pem: the certificate chain, encoded in PEM format.
§Errors
Returns an error when the certificate was unable to be written sucessfully.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".