Mercurial > public > mercurial-scm > hg
changeset 52815:4e58167a72a5
rust-pyo3-revlog: trivial properties
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 02 Jan 2025 17:45:58 +0100 |
parents | 3fcd86374074 |
children | 6c121468b026 |
files | rust/hg-pyo3/src/revlog/mod.rs |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/rust/hg-pyo3/src/revlog/mod.rs Thu Jan 02 17:44:52 2025 +0100 +++ b/rust/hg-pyo3/src/revlog/mod.rs Thu Jan 02 17:45:58 2025 +0100 @@ -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(),