dbrowser · commands::dns
Source declarations, signatures and documentation for commands::dns.
Source: sigil/weave/tools/dbrowser/src-tauri/src/commands/dns.rs. SHA-256: 59107853bbf8c2857a1d572465397179add827c03d7881a24d76a6822e33ef99.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
commands::dns::DnsRecord
A single DNS resource record.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DnsRecord {
/// Unique identifier for the record (UUID string).
pub id: String,
/// Record type: A, AAAA, TXT, CNAME, NS.
pub record_type: String,
/// Record name (subdomain or "@" for root).
pub name: String,
/// Record value (IP address, hostname, text, etc.).
pub value: String,
/// Time-to-live in seconds.
pub ttl: u32
}Source line: 18.
commands::dns::DomainLookup
Result of a domain lookup.
#[derive(Debug, Serialize)]
pub struct DomainLookup {
/// The queried domain name.
pub domain: String,
/// Whether the domain is registered on the DHT.
pub registered: bool,
/// Current owner DID (if registered).
pub owner: Option<String>,
/// DNS records associated with this domain.
pub records: Vec<DnsRecord>
}Source line: 46.
commands::dns::DomainSearchResult
Result of a domain availability search.
#[derive(Debug, Serialize)]
pub struct DomainSearchResult {
/// The domain name.
pub name: String,
/// Whether the domain is available for registration.
pub available: bool,
/// Current bid price in HNS (if in auction).
pub price_hns: Option<f64>
}Source line: 59.
commands::dns::lookup_domain
Look up a domain by querying the Weave DHT for its DNS records.
Returns the domain's registration status, owner DID, and resource records if found. Returns unregistered status if no records exist.
#[tauri::command]
pub async fn lookup_domain(
name: String,
state: State<'_, AppState>,
) -> Result<DomainLookup, String>;Source line: 195.
commands::dns::update_records
Update DNS records for a domain by publishing to the Weave DHT.
The caller's node DID is recorded as the domain owner. Records are
serialized to JSON and stored under the /dns/<domain> key.
#[tauri::command]
pub async fn update_records(
domain: String,
records: Vec<DnsRecord>,
state: State<'_, AppState>,
) -> Result<Vec<DnsRecord>, String>;Source line: 254.
commands::dns::search_domains
Search for domain availability by probing the DHT.
Checks a set of candidate names derived from the query. Each name is looked up on the DHT to determine availability.
#[tauri::command]
pub async fn search_domains(
query: String,
state: State<'_, AppState>,
) -> Result<Vec<DomainSearchResult>, String>;Source line: 325.