MCPcopy Index your code
hub / github.com/RustPython/RustPython / new_readonly_getset

Method new_readonly_getset

crates/vm/src/vm/context.rs:693–705  ·  view source on GitHub ↗
(
        &self,
        name: impl Into<String>,
        class: &'static Py<PyType>,
        f: F,
    )

Source from the content-addressed store, hash-verified

691 }
692
693 pub fn new_readonly_getset<F, T>(
694 &self,
695 name: impl Into<String>,
696 class: &'static Py<PyType>,
697 f: F,
698 ) -> PyRef<PyGetSet>
699 where
700 F: IntoPyGetterFunc<T>,
701 {
702 let name = name.into();
703 let getset = PyGetSet::new(name, class).with_get(f);
704 PyRef::new_ref(getset, self.types.getset_type.to_owned(), None)
705 }
706
707 pub fn new_static_getset<G, S, T, U>(
708 &self,

Callers 1

extend_pyclassMethod · 0.80

Calls 3

newFunction · 0.85
with_getMethod · 0.80
to_ownedMethod · 0.45

Tested by

no test coverage detected