struct PyClassImplsBuilder<'a> {
cls: &'a Ident,
attr: &'a PyClassArgs,
methods_type: PyClassMethodsType,
default_methods: Vec<MethodAndMethodDef>,
default_slots: Vec<MethodAndSlotDef>,
doc: Option<PythonDoc>,
}
Expand description
Implements most traits used by #[pyclass]
.
Specifically, it implements traits that only depend on class name,
and attributes of #[pyclass]
, and docstrings.
Therefore it doesn’t implement traits that depends on struct fields and enum variants.
Fields§
§cls: &'a Ident
§attr: &'a PyClassArgs
§methods_type: PyClassMethodsType
§default_methods: Vec<MethodAndMethodDef>
§default_slots: Vec<MethodAndSlotDef>
§doc: Option<PythonDoc>
Implementations§
Source§impl<'a> PyClassImplsBuilder<'a>
impl<'a> PyClassImplsBuilder<'a>
fn new( cls: &'a Ident, attr: &'a PyClassArgs, methods_type: PyClassMethodsType, default_methods: Vec<MethodAndMethodDef>, default_slots: Vec<MethodAndSlotDef>, ) -> Self
fn doc(self, doc: PythonDoc) -> Self
fn impl_all(&self, ctx: &Ctx) -> Result<TokenStream>
fn impl_pyclass(&self, ctx: &Ctx) -> TokenStream
fn impl_extractext(&self, ctx: &Ctx) -> TokenStream
fn impl_into_py(&self, ctx: &Ctx) -> TokenStream
fn impl_pyclassimpl(&self, ctx: &Ctx) -> Result<TokenStream>
fn impl_add_to_module(&self, ctx: &Ctx) -> TokenStream
fn impl_freelist(&self, ctx: &Ctx) -> TokenStream
fn freelist_slots(&self, ctx: &Ctx) -> Vec<TokenStream>
Auto Trait Implementations§
impl<'a> Freeze for PyClassImplsBuilder<'a>
impl<'a> RefUnwindSafe for PyClassImplsBuilder<'a>
impl<'a> !Send for PyClassImplsBuilder<'a>
impl<'a> !Sync for PyClassImplsBuilder<'a>
impl<'a> Unpin for PyClassImplsBuilder<'a>
impl<'a> UnwindSafe for PyClassImplsBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more