Struct pyo3_macros_backend::defs::Proto
source · [−]pub struct Proto {
pub name: &'static str,
module: &'static str,
pub methods: &'static [MethodProto],
pub py_methods: &'static [PyMethod],
slot_defs: &'static [SlotDef],
}
This is supported on crate feature
pyproto
only.Expand description
Predicates for #[pyproto]
.
Fields
name: &'static str
The name of this protocol. E.g., Iter.
module: &'static str
The path to the module which contains this proto implementation.
methods: &'static [MethodProto]
Trait which stores the slots Trait method which accesses the slots. All methods.
py_methods: &'static [PyMethod]
All methods registered as normal methods like #[pymethods]
.
slot_defs: &'static [SlotDef]
All methods registered to the slot table.
Implementations
sourceimpl Proto
impl Proto
pub(crate) fn get_proto<Q>(&self, query: Q) -> Option<&'static MethodProto> where
Q: PartialEq<&'static str>,
pub(crate) fn get_method<Q>(&self, query: Q) -> Option<&'static PyMethod> where
Q: PartialEq<&'static str>,
pub(crate) fn module(&self) -> Path
pub(crate) fn slot_defs(
&self,
implemented_protocols: HashSet<String>
) -> impl Iterator<Item = &'static SlotDef>
pub(crate) fn items_trait(&self) -> Ident
pub(crate) fn items_trait_items(&self) -> Ident
Auto Trait Implementations
impl RefUnwindSafe for Proto
impl Send for Proto
impl Sync for Proto
impl Unpin for Proto
impl UnwindSafe for Proto
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more