pub struct AnsClient { /* private fields */ }Expand description
Skeleton client for Aptos Names Service.
All methods currently return
AptosError::Internal
so callers fail fast rather than silently accepting placeholder values.
Implementations§
Source§impl AnsClient
impl AnsClient
Sourcepub fn new(fullnode: FullnodeClient) -> Self
pub fn new(fullnode: FullnodeClient) -> Self
Constructs a new ANS client bound to a given fullnode.
Sourcepub async fn lookup(&self, _name: &str) -> AptosResult<AccountAddress>
pub async fn lookup(&self, _name: &str) -> AptosResult<AccountAddress>
Resolves an ANS name (e.g. "alice.apt") to its registered
AccountAddress.
§Errors
Currently always returns AptosError::Internal; the lookup is
scheduled but not yet wired up. Track progress against the audit
follow-up issue cited in this module’s docs.
Sourcepub async fn reverse_lookup(
&self,
_address: AccountAddress,
) -> AptosResult<Option<String>>
pub async fn reverse_lookup( &self, _address: AccountAddress, ) -> AptosResult<Option<String>>
Finds the primary ANS name registered to a given address, if any.
§Errors
Currently always returns AptosError::Internal; the reverse
lookup is scheduled but not yet wired up.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnsClient
impl !RefUnwindSafe for AnsClient
impl Send for AnsClient
impl Sync for AnsClient
impl Unpin for AnsClient
impl UnsafeUnpin for AnsClient
impl !UnwindSafe for AnsClient
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