feat: early interface with Python

This commit is contained in:
2025-03-13 15:38:51 -04:00
parent afe5eae96b
commit 96495b2a85
22 changed files with 623 additions and 6 deletions

16
src/arbitrary/map.rs Normal file
View File

@@ -0,0 +1,16 @@
use std::collections::BTreeMap;
use pyo3::prelude::*;
use super::{arbitrary::Arbitrary, map_key::MapKey};
#[derive(Debug, Clone, derive_more::From, derive_more::Into)]
pub struct Map(pub BTreeMap<MapKey, Arbitrary>);
impl<'py> FromPyObject<'py> for Map {
fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
let inner: BTreeMap<MapKey, Arbitrary> = ob.extract()?;
Ok(Self(inner))
}
}