pub struct PySigMatch {
pub prefix: Option<String>,
pub name: String,
pub tp_list: Option<String>,
pub arglist: Option<String>,
pub retann: Option<String>,
pub tp_span: (usize, usize),
pub arg_span: (usize, usize),
}Expand description
The py_sig_re match carrier (_object.py:41-50): groups (prefix,
name, tp_list, arglist, retann) plus the two inner-text spans the
multi-line measurement subtracts (_object.py:300-311). Task 6’s
handle_py_signature constructs this from its matcher; spans are BYTE
offsets of the group’s inner text within the stripped signature,
(0, 0) when the group did not participate (Python’s (-1, -1) span
normalizes to width 0 either way).
Fields§
§prefix: Option<String>Group 1: dotted class prefix including the trailing ..
name: StringGroup 2: the object name.
tp_list: Option<String>Group 3: inner text of the [type params] brackets.
arglist: Option<String>Group 4: inner text of the (...) parens.
retann: Option<String>Group 5: return annotation after ->.
tp_span: (usize, usize)Byte span of group 3’s inner text within the stripped sig.
arg_span: (usize, usize)Byte span of group 4’s inner text within the stripped sig.
Trait Implementations§
Source§impl Clone for PySigMatch
impl Clone for PySigMatch
Source§fn clone(&self) -> PySigMatch
fn clone(&self) -> PySigMatch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PySigMatch
impl Debug for PySigMatch
impl Eq for PySigMatch
Source§impl PartialEq for PySigMatch
impl PartialEq for PySigMatch
impl StructuralPartialEq for PySigMatch
Auto Trait Implementations§
impl Freeze for PySigMatch
impl RefUnwindSafe for PySigMatch
impl Send for PySigMatch
impl Sync for PySigMatch
impl Unpin for PySigMatch
impl UnsafeUnpin for PySigMatch
impl UnwindSafe for PySigMatch
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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