pub struct ZoneDiscovery { /* private fields */ }Expand description
Reads which zones a token can reach, so nobody has to copy a hex id out of
the dashboard. Separate from Provisioner, which cannot be built until an
account and a zone have been picked — which is what this is for.
Implementations§
Source§impl ZoneDiscovery
impl ZoneDiscovery
pub fn new(setup_token: String) -> Self
Sourcepub async fn list(&self, mint_reader: bool) -> Result<Vec<ReachableZone>>
pub async fn list(&self, mint_reader: bool) -> Result<Vec<ReachableZone>>
GET /zones carries the owning account on every zone, so one call
settles both ids.
A setup token carries only API Tokens -> Edit and cannot read zones,
so mint_reader has it mint one that can and revokes it afterwards. The
minted policy scopes com.cloudflare.api.account.* — a wildcard the
tokens API accepts, and the only form available here, since the account
id is the thing being discovered. Measured against the live API.
Auto Trait Implementations§
impl !RefUnwindSafe for ZoneDiscovery
impl !UnwindSafe for ZoneDiscovery
impl Freeze for ZoneDiscovery
impl Send for ZoneDiscovery
impl Sync for ZoneDiscovery
impl Unpin for ZoneDiscovery
impl UnsafeUnpin for ZoneDiscovery
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