-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
A.Shpak
committed
May 10, 2024
1 parent
6de7469
commit 3ca3751
Showing
6 changed files
with
49 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
use std::str::FromStr; | ||
|
||
use pyo3::prelude::{pymodule, PyModule, PyResult, Python}; | ||
use pyo3::wrap_pyfunction; | ||
use pyo3::prelude::{pymodule, wrap_pyfunction, Bound, PyModule, PyResult, Python}; | ||
|
||
use crate::errors::XIDError; | ||
use crate::utils::{xid_create, xid_from_bytes, xid_from_str}; | ||
use crate::wrapper::XID; | ||
|
||
const PY_MODULE_VERSION: &str = "1.0.5"; | ||
|
||
mod errors; | ||
mod utils; | ||
mod wrapper; | ||
|
||
#[pymodule] | ||
fn epyxid(_py: Python, m: &PyModule) -> PyResult<()> { | ||
fn epyxid(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { | ||
m.add_class::<XID>()?; | ||
m.add_function(wrap_pyfunction!(xid_create, m)?)?; | ||
m.add_function(wrap_pyfunction!(xid_from_str, m)?)?; | ||
m.add_function(wrap_pyfunction!(xid_from_bytes, m)?)?; | ||
m.add("XIDError", _py.get_type::<XIDError>())?; | ||
m.add("XIDError", py.get_type_bound::<XIDError>())?; | ||
m.add("__version__", PY_MODULE_VERSION)?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters