pub(crate) struct Parameters(Vec<ParameterWithKind>);Expand description
Collection of parameters with their kinds determined
This newtype wraps Vec<ParameterWithKind> and provides constructors that
parse PyO3 signature attributes and classify parameters accordingly.
Tuple Fields§
§0: Vec<ParameterWithKind>Implementations§
Source§impl Parameters
impl Parameters
Sourcepub(crate) fn from_vec(parameters: Vec<ParameterWithKind>) -> Self
pub(crate) fn from_vec(parameters: Vec<ParameterWithKind>) -> Self
Create Parameters from a Vec
This is used when parameters are already classified (e.g., from Python AST).
Sourcepub(crate) fn iter_mut(
&mut self,
) -> impl Iterator<Item = &mut ParameterWithKind>
pub(crate) fn iter_mut( &mut self, ) -> impl Iterator<Item = &mut ParameterWithKind>
Get mutable access to internal parameters
Sourcepub(crate) fn new(args: &[ArgInfo]) -> Self
pub(crate) fn new(args: &[ArgInfo]) -> Self
Create parameters without signature attribute
All parameters will be classified as PositionalOrKeyword.
Sourcepub(crate) fn new_with_sig(args: &[ArgInfo], sig: &Signature) -> Result<Self>
pub(crate) fn new_with_sig(args: &[ArgInfo], sig: &Signature) -> Result<Self>
Create parameters with signature attribute
Parses the signature to determine parameter kinds based on delimiters
(/ for positional-only, * for keyword-only, etc.).
Trait Implementations§
Source§impl Clone for Parameters
impl Clone for Parameters
Source§fn clone(&self) -> Parameters
fn clone(&self) -> Parameters
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Parameters
impl Debug for Parameters
Source§impl ToTokens for Parameters
impl ToTokens for Parameters
Source§fn to_tokens(&self, tokens: &mut TokenStream2)
fn to_tokens(&self, tokens: &mut TokenStream2)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for Parameters
impl RefUnwindSafe for Parameters
impl !Send for Parameters
impl !Sync for Parameters
impl Unpin for Parameters
impl UnwindSafe for Parameters
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,
§impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
fn exact_into(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
§impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)
§impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
fn saturating_into(self) -> U
Source§impl<T> Spanned for T
impl<T> Spanned for T
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.