pub enum ImplExprKind {
Self_,
Concrete(TraitGoal),
LocalBound {
id: Symbol,
},
Parent {
impl_: ImplExpr,
ident: ImplIdent,
},
Projection {
impl_: ImplExpr,
item: GlobalId,
ident: ImplIdent,
},
ImplApp {
impl_: ImplExpr,
args: Vec<ImplExpr>,
},
Dyn,
Builtin(TraitGoal),
Error(ErrorNode),
}Expand description
Variants§
Self_
The trait implementation being defined.
§Example:
The impl expr for Type: Trait used in self.f() is Self_.
ⓘ
impl Trait for Type {
fn f(&self) {...}
fn g(&self) {self.f()}
}Concrete(TraitGoal)
A concrete impl block.
§Example
ⓘ
impl Clone for Type { // Consider this `impl` is called `impl0`
...
}
fn f(x: Type) {
x.clone() // Here `clone` comes from `Concrete(impl0)`
}LocalBound
A bound introduced by a generic clause.
§Example:
ⓘ
fn f<T: Clone>(x: T) -> T {
x.clone() // Here the method comes from the bound `T: Clone`
}Parent
A parent implementation.
§Example:
ⓘ
trait SubTrait: Clone {}
fn f<T: SubTrait>(x: T) -> T {
x.clone() // Here the method comes from the parent of the bound `T: SubTrait`
}Fields
Projection
A projected associated implementation.
§Example:
In this snippet, T::Item is an AssociatedType where the subsequent ImplExpr
is a type projection of ITerator.
ⓘ
fn f<T: Iterator>(x: T) -> Option<T::Item> {
x.next()
}Fields
ImplApp
An instantiation of a generic implementation.
§Example:
ⓘ
fn f<T: Clone>(x: Vec<T>) -> Vec<T> {
x.clone() // The `Clone` implementation for `Vec` is instantiated with the local bound `T: Clone`
}Fields
Dyn
The implementation provided by a dyn.
Builtin(TraitGoal)
A trait implemented natively by rust.
Error(ErrorNode)
Fallback constructor to carry errors.
Trait Implementations§
Source§impl AnyFragment for ImplExprKind
impl AnyFragment for ImplExprKind
Source§fn type_id() -> FragmentTypeId
fn type_id() -> FragmentTypeId
Get a type identifier for this fragment.
Source§fn as_fragment<'a>(&'a self, type_id: FragmentTypeId) -> Option<FragmentRef<'a>>
fn as_fragment<'a>(&'a self, type_id: FragmentTypeId) -> Option<FragmentRef<'a>>
Coerce as a fragment reference.
Source§fn as_owned_fragment(&self, type_id: FragmentTypeId) -> Option<Fragment>
fn as_owned_fragment(&self, type_id: FragmentTypeId) -> Option<Fragment>
Coerce as an owned fragment.
Source§impl AstVisitable for ImplExprKind
impl AstVisitable for ImplExprKind
Source§fn drive_map<V: AstVisitorMut>(&mut self, v: &mut V)
fn drive_map<V: AstVisitorMut>(&mut self, v: &mut V)
Recursively visit this type with the provided visitor. This calls the visitor’s
visit_$any
method if it exists, otherwise visit_inner.Source§fn drive<V: AstVisitor>(&self, v: &mut V)
fn drive<V: AstVisitor>(&self, v: &mut V)
Recursively visit this type with the provided visitor. This calls the visitor’s
visit_$any
method if it exists, otherwise visit_inner.Source§impl AstVisitable for ImplExprKind
impl AstVisitable for ImplExprKind
Source§fn drive<V: AstEarlyExitVisitor>(&self, v: &mut V) -> ControlFlow<V::Break>
fn drive<V: AstEarlyExitVisitor>(&self, v: &mut V) -> ControlFlow<V::Break>
Recursively visit this type with the provided visitor. This calls the visitor’s
visit_$any
method if it exists, otherwise visit_inner.Source§fn drive_mut<V: AstEarlyExitVisitorMut>(
&mut self,
v: &mut V,
) -> ControlFlow<V::Break>
fn drive_mut<V: AstEarlyExitVisitorMut>( &mut self, v: &mut V, ) -> ControlFlow<V::Break>
Recursively visit this type with the provided visitor. This calls the visitor’s
visit_$any
method if it exists, otherwise visit_inner.Source§impl Clone for ImplExprKind
impl Clone for ImplExprKind
Source§fn clone(&self) -> ImplExprKind
fn clone(&self) -> ImplExprKind
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 ImplExprKind
impl Debug for ImplExprKind
Source§impl<'de> Deserialize<'de> for ImplExprKind
impl<'de> Deserialize<'de> for ImplExprKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'s, V> Drive<'s, V> for ImplExprKind
impl<'s, V> Drive<'s, V> for ImplExprKind
Source§fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
Call
v.visit() on the immediate contents of self.Source§impl<'s, V> DriveMut<'s, V> for ImplExprKind
impl<'s, V> DriveMut<'s, V> for ImplExprKind
Source§fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
Call
v.visit() on the immediate contents of self.impl Eq for ImplExprKind
Source§impl<'lt> From<&'lt ImplExprKind> for FragmentRef<'lt>
impl<'lt> From<&'lt ImplExprKind> for FragmentRef<'lt>
Source§fn from(fragment: &'lt ImplExprKind) -> Self
fn from(fragment: &'lt ImplExprKind) -> Self
Converts to this type from the input type.
Source§impl From<ImplExprKind> for Fragment
impl From<ImplExprKind> for Fragment
Source§fn from(fragment: ImplExprKind) -> Self
fn from(fragment: ImplExprKind) -> Self
Converts to this type from the input type.
Source§impl Hash for ImplExprKind
impl Hash for ImplExprKind
Source§impl JsonSchema for ImplExprKind
impl JsonSchema for ImplExprKind
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl Ord for ImplExprKind
impl Ord for ImplExprKind
Source§fn cmp(&self, other: &ImplExprKind) -> Ordering
fn cmp(&self, other: &ImplExprKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ImplExprKind
impl PartialEq for ImplExprKind
Source§impl PartialOrd for ImplExprKind
impl PartialOrd for ImplExprKind
Source§impl Serialize for ImplExprKind
impl Serialize for ImplExprKind
impl StructuralPartialEq for ImplExprKind
Auto Trait Implementations§
impl Freeze for ImplExprKind
impl RefUnwindSafe for ImplExprKind
impl Send for ImplExprKind
impl Sync for ImplExprKind
impl Unpin for ImplExprKind
impl UnsafeUnpin for ImplExprKind
impl UnwindSafe for ImplExprKind
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ExtensionPoint for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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