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§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more