pub enum FnType {
Getter(SelfType),
Setter(SelfType),
Fn(SelfType),
FnNew,
FnNewClass(Span),
FnClass(Span),
FnStatic,
FnModule(Span),
ClassAttribute,
}
Expand description
Represents what kind of a function a pyfunction or pymethod is
Variants§
Getter(SelfType)
Represents a pymethod annotated with #[getter]
Setter(SelfType)
Represents a pymethod annotated with #[setter]
Fn(SelfType)
Represents a regular pymethod
FnNew
Represents a pymethod annotated with #[new]
, i.e. the __new__
dunder.
FnNewClass(Span)
Represents a pymethod annotated with both #[new]
and #[classmethod]
(in either order)
FnClass(Span)
Represents a pymethod annotated with #[classmethod]
, like a @classmethod
FnStatic
Represents a pyfunction or a pymethod annotated with #[staticmethod]
, like a @staticmethod
FnModule(Span)
Represents a pyfunction annotated with `#[pyo3(pass_module)]
ClassAttribute
Represents a pymethod or associated constant annotated with #[classattr]
Implementations§
Source§impl FnType
impl FnType
pub fn skip_first_rust_argument_in_python_signature(&self) -> bool
pub fn signature_attribute_allowed(&self) -> bool
pub fn self_arg( &self, cls: Option<&Type>, error_mode: ExtractErrorMode, holders: &mut Holders, ctx: &Ctx, ) -> Option<TokenStream>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FnType
impl RefUnwindSafe for FnType
impl !Send for FnType
impl !Sync for FnType
impl Unpin for FnType
impl UnwindSafe for FnType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)