nma4 0.1.2

Rust bindings for the libnma library.
Documentation
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from girs
// from gtk-girs (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{MobileAccessMethod, ffi};
use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct MobileProvider(Shared<ffi::NMAMobileProvider>);

    match fn {
        ref => |ptr| ffi::nma_mobile_provider_ref(ptr),
        unref => |ptr| ffi::nma_mobile_provider_unref(ptr),
        type_ => || ffi::nma_mobile_provider_get_type(),
    }
}

impl MobileProvider {
    #[doc(alias = "nma_mobile_provider_get_3gpp_mcc_mnc")]
    pub fn get_3gpp_mcc_mnc(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::nma_mobile_provider_get_3gpp_mcc_mnc(
                self.to_glib_none().0,
            ))
        }
    }

    // #[doc(alias = "nma_mobile_provider_get_cdma_sid")]
    // #[doc(alias = "get_cdma_sid")]
    // pub fn cdma_sid(&self) -> Vec<u32> {
    //     unsafe {
    //         FromGlibPtrContainer::from_glib_none(ffi::nma_mobile_provider_get_cdma_sid(
    //             self.to_glib_none().0,
    //         ))
    //     }
    // }

    ///
    /// # Returns
    ///
    /// the
    ///  list of #NMAMobileAccessMethod this provider exposes.
    #[doc(alias = "nma_mobile_provider_get_methods")]
    #[doc(alias = "get_methods")]
    pub fn methods(&self) -> Vec<MobileAccessMethod> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::nma_mobile_provider_get_methods(
                self.to_glib_none().0,
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// the name of the provider.
    #[doc(alias = "nma_mobile_provider_get_name")]
    #[doc(alias = "get_name")]
    pub fn name(&self) -> glib::GString {
        unsafe { from_glib_none(ffi::nma_mobile_provider_get_name(self.to_glib_none().0)) }
    }
}

impl std::fmt::Display for MobileProvider {
    #[inline]
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.write_str(&self.name())
    }
}