Skip to content
Snippets Groups Projects
Commit 4e58167a authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

rust-pyo3-revlog: trivial properties

parent 3fcd8637
No related branches found
No related tags found
2 merge requests!1292Draft: 7.0rc preparation,!1203Port all hg-cpython revlog code to Pyo3
......@@ -231,6 +231,34 @@
})
}
#[getter]
fn is_delaying(slf: &Bound<'_, Self>) -> PyResult<bool> {
Self::with_core_read(slf, |_self_ref, irl| Ok(irl.is_delaying()))
}
#[getter]
fn inline(slf: &Bound<'_, Self>) -> PyResult<bool> {
Self::with_core_read(slf, |_self_ref, irl| Ok(irl.is_inline()))
}
#[setter]
fn set_inline(slf: &Bound<'_, Self>, inline: bool) -> PyResult<()> {
Self::with_core_write(slf, |_self_ref, mut irl| {
irl.inline = inline;
Ok(())
})
}
#[getter]
fn is_writing(slf: &Bound<'_, Self>) -> PyResult<bool> {
Self::with_core_read(slf, |_self_ref, irl| Ok(irl.is_writing()))
}
#[getter]
fn is_open(slf: &Bound<'_, Self>) -> PyResult<bool> {
Self::with_core_read(slf, |_self_ref, irl| Ok(irl.is_open()))
}
fn reading(slf: &Bound<'_, Self>) -> PyResult<ReadingContextManager> {
Ok(ReadingContextManager {
inner_revlog: slf.clone().unbind(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment