Skip to main content

MethodArgAccess

Trait MethodArgAccess 

Source
pub trait MethodArgAccess<'de, 's> {
    type Error: Error;
    type ContentDeserializer: Deserializer<'de, Error = Self::Error>;

    // Required methods
    fn src(&self) -> Option<&'s str>;
    fn dst(&self) -> Option<impl Iterator<Item = &'s str>>;
    fn pos(&self) -> Option<usize>;
    fn lv_index(&self) -> Option<usize>;
    fn content(self) -> Self::ContentDeserializer;
}
Expand description

Method argument name, pos, slot and comment accessor.

Required Associated Types§

Source

type Error: Error

Error type.

Source

type ContentDeserializer: Deserializer<'de, Error = Self::Error>

Type of deserializer of the element’s contents.

Required Methods§

Source

fn src(&self) -> Option<&'s str>

Source simple name.

Source

fn dst(&self) -> Option<impl Iterator<Item = &'s str>>

Destination simple names.

Source

fn pos(&self) -> Option<usize>

The position of this argument starts from zero, and increase by one.

Source

fn lv_index(&self) -> Option<usize>

The local variable index of this parameter in the current method.

Starts at zero for static methods and one otherwise, increase by 1, or by 2 if it’s a double-wide primitive.

Also known as slot.

Source

fn content(self) -> Self::ContentDeserializer

Returns the content deserializer for further deserialization of this method.

It may only contain comments.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§