pub struct PyGeoDb { /* private fields */ }Implementations§
Source§impl PyGeoDb
impl PyGeoDb
pub fn load(path: &str) -> PyResult<Self>
pub fn load_default() -> PyResult<Self>
pub fn load_filtered(iso2_list: Vec<String>) -> PyResult<Self>
pub fn stats(&self) -> PyResult<(usize, usize, usize)>
Sourcepub fn countries<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>>
pub fn countries<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>>
Return a list of all countries as dicts
Sourcepub fn find_country<'py>(
&self,
py: Python<'py>,
code: &str,
) -> PyResult<Option<Bound<'py, PyAny>>>
pub fn find_country<'py>( &self, py: Python<'py>, code: &str, ) -> PyResult<Option<Bound<'py, PyAny>>>
Find a country by ISO2/ISO3/code and return as dict (or None)
Sourcepub fn states_in_country<'py>(
&self,
py: Python<'py>,
iso2: &str,
) -> PyResult<Option<Bound<'py, PyAny>>>
pub fn states_in_country<'py>( &self, py: Python<'py>, iso2: &str, ) -> PyResult<Option<Bound<'py, PyAny>>>
List all states for a given country ISO2 as dicts
Sourcepub fn search_countries_by_phone<'py>(
&self,
py: Python<'py>,
phone: &str,
) -> PyResult<Bound<'py, PyAny>>
pub fn search_countries_by_phone<'py>( &self, py: Python<'py>, phone: &str, ) -> PyResult<Bound<'py, PyAny>>
Find countries by phone code (e.g. “+49”, “1”) and return list of dicts
Sourcepub fn find_states_by_substring<'py>(
&self,
py: Python<'py>,
substr: &str,
) -> PyResult<Bound<'py, PyAny>>
pub fn find_states_by_substring<'py>( &self, py: Python<'py>, substr: &str, ) -> PyResult<Bound<'py, PyAny>>
Find states containing a substring (ASCII, case-insensitive). Returns list of dicts
Trait Implementations§
impl DerefToPyAny for PyGeoDb
Source§impl PyClassImpl for PyGeoDb
impl PyClassImpl for PyGeoDb
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = SendablePyClass<PyGeoDb>
type ThreadChecker = SendablePyClass<PyGeoDb>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyMethods<PyGeoDb> for PyClassImplCollector<PyGeoDb>
impl PyMethods<PyGeoDb> for PyClassImplCollector<PyGeoDb>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PyGeoDb
impl PyTypeInfo for PyGeoDb
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
Auto Trait Implementations§
impl Freeze for PyGeoDb
impl RefUnwindSafe for PyGeoDb
impl Send for PyGeoDb
impl Sync for PyGeoDb
impl Unpin for PyGeoDb
impl UnsafeUnpin for PyGeoDb
impl UnwindSafe for PyGeoDb
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