Skip to content

Commit

Permalink
add api conversion method to FerveoVariant
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Jul 11, 2023
1 parent 7cbe65d commit fbb97be
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ferveo/src/bindings_python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ pub fn decrypt_with_shared_secret(
}

#[pyclass(module = "ferveo")]
struct FerveoVariant {}
pub struct FerveoVariant {}

#[pymethods]
impl FerveoVariant {
Expand All @@ -283,6 +283,13 @@ impl FerveoVariant {
}
}

impl FerveoVariant {
pub fn inner_form_string(variant: &str) -> PyResult<api::FerveoVariant> {
api::FerveoVariant::from_string(variant)
.map_err(|err| FerveoPythonError::FerveoError(err).into())
}
}

#[pyclass(module = "ferveo")]
#[derive(derive_more::AsRef)]
pub struct SharedSecret(api::SharedSecret);
Expand Down

0 comments on commit fbb97be

Please sign in to comment.