technitium 0.4.0

Typed async Rust client for the Technitium DNS Server API
Documentation
/// Trait for converting a type into API query parameters.
pub(crate) trait AsParams {
    fn as_params(&self) -> Vec<(String, String)>;
}

/// Push a required parameter.
pub(crate) fn push(params: &mut Vec<(String, String)>, key: &str, value: &impl ToString) {
    params.push((key.to_string(), value.to_string()));
}

/// Push an optional parameter (only if `Some`).
pub(crate) fn push_opt(
    params: &mut Vec<(String, String)>,
    key: &str,
    value: Option<&impl ToString>,
) {
    if let Some(v) = value {
        params.push((key.to_string(), v.to_string()));
    }
}