pub struct FreeDomains<'a> { /* private fields */ }Expand description
Free domain routes, from Client::free_domains. They work without an API key.
Implementations§
Source§impl<'a> FreeDomains<'a>
impl<'a> FreeDomains<'a>
Sourcepub async fn list(&self) -> Result<FreeDomainList>
pub async fn list(&self) -> Result<FreeDomainList>
The free domains and the per-user lease limit.
GET /api/v1/free-domains
Sourcepub async fn available(
&self,
domain: &str,
label: &str,
) -> Result<FreeLabelAvailability>
pub async fn available( &self, domain: &str, label: &str, ) -> Result<FreeLabelAvailability>
Whether <label>.<domain> can be leased now. The answer can change before the
lease; Zones::create checks again. The caller’s own
lease limit is not checked here.
GET /api/v1/free-domains/:domain/available?label=
§Errors
ErrorCode::NotFoundifdomainis not a free domain.ErrorCode::Validationfor an empty label.
§Examples
let check = client.free_domains().available("dinio.eu", "myhome").await?;
if check.available {
client.zones().create(&check.name).await?;
} else {
println!("{}: {}", check.name, check.reason.unwrap_or_default());
}Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FreeDomains<'a>
impl<'a> !UnwindSafe for FreeDomains<'a>
impl<'a> Freeze for FreeDomains<'a>
impl<'a> Send for FreeDomains<'a>
impl<'a> Sync for FreeDomains<'a>
impl<'a> Unpin for FreeDomains<'a>
impl<'a> UnsafeUnpin for FreeDomains<'a>
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