rust/hg-pyo3/src/revlog/mod.rs
changeset 52815 4e58167a72a5
parent 52814 3fcd86374074
child 52816 6c121468b026
equal deleted inserted replaced
52814:3fcd86374074 52815:4e58167a72a5
   227     ) -> PyResult<Py<PyBytes>> {
   227     ) -> PyResult<Py<PyBytes>> {
   228         Self::with_core_read(slf, |_self_ref, irl| {
   228         Self::with_core_read(slf, |_self_ref, irl| {
   229             let path = irl.canonical_index_file();
   229             let path = irl.canonical_index_file();
   230             Ok(PyBytes::new(py, &get_bytes_from_path(path)).into())
   230             Ok(PyBytes::new(py, &get_bytes_from_path(path)).into())
   231         })
   231         })
       
   232     }
       
   233 
       
   234     #[getter]
       
   235     fn is_delaying(slf: &Bound<'_, Self>) -> PyResult<bool> {
       
   236         Self::with_core_read(slf, |_self_ref, irl| Ok(irl.is_delaying()))
       
   237     }
       
   238 
       
   239     #[getter]
       
   240     fn inline(slf: &Bound<'_, Self>) -> PyResult<bool> {
       
   241         Self::with_core_read(slf, |_self_ref, irl| Ok(irl.is_inline()))
       
   242     }
       
   243 
       
   244     #[setter]
       
   245     fn set_inline(slf: &Bound<'_, Self>, inline: bool) -> PyResult<()> {
       
   246         Self::with_core_write(slf, |_self_ref, mut irl| {
       
   247             irl.inline = inline;
       
   248             Ok(())
       
   249         })
       
   250     }
       
   251 
       
   252     #[getter]
       
   253     fn is_writing(slf: &Bound<'_, Self>) -> PyResult<bool> {
       
   254         Self::with_core_read(slf, |_self_ref, irl| Ok(irl.is_writing()))
       
   255     }
       
   256 
       
   257     #[getter]
       
   258     fn is_open(slf: &Bound<'_, Self>) -> PyResult<bool> {
       
   259         Self::with_core_read(slf, |_self_ref, irl| Ok(irl.is_open()))
   232     }
   260     }
   233 
   261 
   234     fn reading(slf: &Bound<'_, Self>) -> PyResult<ReadingContextManager> {
   262     fn reading(slf: &Bound<'_, Self>) -> PyResult<ReadingContextManager> {
   235         Ok(ReadingContextManager {
   263         Ok(ReadingContextManager {
   236             inner_revlog: slf.clone().unbind(),
   264             inner_revlog: slf.clone().unbind(),