Skip to main content
Version: v0.35.0

TraitDefinition

std::meta::trait_def contains methods on the built-in TraitDefinition type. This type represents trait definitions such as trait Foo { .. } at the top-level of a program.

Methods

as_trait_constraint

as_trait_constraint
comptime fn as_trait_constraint(_self: Self) -> TraitConstraint {}

Source code: noir_stdlib/src/meta/trait_def.nr#L6-L8

Converts this trait into a trait constraint. If there are any generics on this trait, they will be kept as-is without instantiating or replacing them.

Trait Implementations

impl Eq for TraitDefinition
impl Hash for TraitDefinition