You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dns.rs
    path of file: ./repos/nmstate/rust/src/lib/nm/nm_dbus
    
    the code of the file until where you have to start completion: // SPDX-License-Identifier: Apache-2.0

use std::collections::HashMap;
use std::convert::TryFrom;

use super::{connection::_from_map, NmError};

#[derive(Debug, Clone, PartialEq, Default)]
pub struct NmDnsEntry {
    pub priority: i32,
    pub domains: Vec<String>,
    pub name_servers: Vec<String>,
    pub interface: String,
    pub is_vpn: bool,
    _other: HashMap<String, zvariant::OwnedValue>,
}

impl TryFrom<HashMap<String, zvariant::OwnedValue>> for NmDnsEntry {
    type Error = NmError;
    fn try_from(
        mut v: HashMap<String, zvariant::OwnedValue>,
    ) -> Result<Self, Self::Error> {
        Ok(Self {
            priority: _from_map!(v, "priority", i32::try_from)?
                .unwrap_or_default(),
            domains: _from_map!(v, "domains", Vec::<String>::try_from)?
                .unwrap_
    
    pub(crate) fn to_value(&self) -> Result<zvariant::Value, NmError> {
        let mut ret = zvariant::Dict::new(
            zvariant::Signature::from_str_unchecked("s"),
            zvariant::Signature::from_str_unchecked("v"),
        );
        if !self.searches.is_empty() {
            ret.append(
                zvariant::Value::new("searches"),
                zvariant::Value::new(zvariant::Value::new(
                    self.searches.clone(),
                )),
            )?;
        }
        if !self.options.is_empty() {
            ret.append(
                zvariant::Value::new("options"),
                zvariant::Value::new(zvariant::Value::new(
                    self.options.clone(),
                )),
            )?;
        }
        if !self.domains.is_empty() {
            ret.append(
                zvariant::Value::new("domains"),
                zvariant::Value::new(global_dns_domain_configs_to_value(
                    &self.domains,
                )?),
            )?;
        }
        Ok(zvariant::Value::Dict(ret))
    }