-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Fixed length arrays up to 32-byte can be used both as parameters and return types in the current version, meaning that the inputs can be bounded at compile time without runtime checkings.
However, arrays over 32-byte long are not supported by PyO3 at the moment (should be after Rust 1.5).
For now, any array over 32-byte long implies a run time checking + an exception throwing on the Python side. e.g:
#[pymethods]
impl PyBlockHeader {
#[new]
fn new(data: &[u8]) -> PyResult<Self> {
if data.len() != 80 {
Err(exceptions::PyValueError::new_err(format!(
"Data must be 80-byte long"
)))
}
[...]
Metadata
Metadata
Assignees
Labels
No labels