Skip to main content

MethodSelector

Enum MethodSelector 

Source
pub enum MethodSelector {
    ClassName(JavaPath),
    MethodName(JavaPath, Ident),
    ClassInfo(ClassInfo),
}
Expand description

There are various points where the user must select a method. In these cases, we permit them to either write just a class name (in which case we search for (hopefully) at most one such method), a class + method name, or a little mini class declaration that includes the full details (which accommodates the case where it is overloaded).

Variants§

§

ClassName(JavaPath)

User wrote foo.bar.Baz

§

MethodName(JavaPath, Ident)

User wrote foo.bar.Baz::method

§

ClassInfo(ClassInfo)

User wrote class Foo { ... } with full details. This class should have at most one member.

Implementations§

Source§

impl MethodSelector

Source

pub fn span(&self) -> Span

Span for things that refer to the method

Source

pub fn class_span(&self) -> Span

Span for things that refer to the class the method is in

Source

pub fn class_name(&self) -> DotId

Source

pub fn method_name(&self) -> String

Returns the name of the method

Trait Implementations§

Source§

impl Parse for MethodSelector

Source§

fn parse(p: &mut Parser) -> Result<Option<Self>>

We assume an LL(1) grammar, so no need for backtracking. Read more
Source§

fn description() -> String

Describes the thing we are parsing, for use in error messages. e.g. “java path”.
Source§

fn parse_many(p: &mut Parser) -> Result<Vec<Self>>

parse any number of instances of self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.