feat: IntoPyObject
implementations for arbitrary types
This commit is contained in:
@@ -4,12 +4,12 @@ use pyo3::prelude::*;
|
||||
|
||||
use super::{arbitrary::Arbitrary, map_key::MapKey};
|
||||
|
||||
#[derive(Debug, Clone, derive_more::From, derive_more::Into)]
|
||||
#[derive(Debug, Clone, Default, derive_more::From, derive_more::Into, IntoPyObject)]
|
||||
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()?;
|
||||
let inner = ob.extract()?;
|
||||
|
||||
Ok(Self(inner))
|
||||
}
|
||||
|
Reference in New Issue
Block a user