pub struct MethodTarget {
pub module: String,
pub type_name: String,
pub method: String,
}Expand description
The declaration a call resolved to, named the way the package names it.
A method call is written against a value, and which declaration it reaches is decided by that value’s type — which only the checker knows. A pass reading the source alone can do no better than match the method’s name, and a name is not unique: two types may declare one, and a declared type and a builtin may share one. Recording the answer is what turns that guess into a lookup.
The three parts name a declaration exactly. module is the module whose
impl block writes it, spelled out even when the call is in that same
module, so a target read anywhere in the package means the same thing.
type_name is the type’s bare name within that module, and method is
the name as declared.
Fields§
§module: StringThe module that declares the type the method is written on.
type_name: StringThe type’s name inside module, without the module qualifier.
method: StringThe method’s own name.
Trait Implementations§
Source§impl Clone for MethodTarget
impl Clone for MethodTarget
Source§fn clone(&self) -> MethodTarget
fn clone(&self) -> MethodTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MethodTarget
impl Debug for MethodTarget
impl Eq for MethodTarget
Source§impl Hash for MethodTarget
impl Hash for MethodTarget
Source§impl Ord for MethodTarget
impl Ord for MethodTarget
Source§fn cmp(&self, other: &MethodTarget) -> Ordering
fn cmp(&self, other: &MethodTarget) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for MethodTarget
impl PartialEq for MethodTarget
Source§fn eq(&self, other: &MethodTarget) -> bool
fn eq(&self, other: &MethodTarget) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for MethodTarget
impl PartialOrd for MethodTarget
impl StructuralPartialEq for MethodTarget
Auto Trait Implementations§
impl Freeze for MethodTarget
impl RefUnwindSafe for MethodTarget
impl Send for MethodTarget
impl Sync for MethodTarget
impl Unpin for MethodTarget
impl UnsafeUnpin for MethodTarget
impl UnwindSafe for MethodTarget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.