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

Method new_static_getset

crates/vm/src/vm/context.rs:707–721  ·  view source on GitHub ↗
(
        &self,
        name: impl Into<String>,
        class: &'static Py<PyType>,
        g: G,
        s: S,
    )

Source from the content-addressed store, hash-verified

705 }
706
707 pub fn new_static_getset<G, S, T, U>(
708 &self,
709 name: impl Into<String>,
710 class: &'static Py<PyType>,
711 g: G,
712 s: S,
713 ) -> PyRef<PyGetSet>
714 where
715 G: IntoPyGetterFunc<T>,
716 S: IntoPySetterFunc<U>,
717 {
718 let name = name.into();
719 let getset = PyGetSet::new(name, class).with_get(g).with_set(s);
720 PyRef::new_ref(getset, self.types.getset_type.to_owned(), None)
721 }
722
723 /// Creates a new `PyGetSet` with a heap type.
724 ///

Callers 2

extend_classMethod · 0.80
new_getsetMethod · 0.80

Calls 4

newFunction · 0.85
with_setMethod · 0.80
with_getMethod · 0.80
to_ownedMethod · 0.45

Tested by

no test coverage detected