Method in macro · TypeDecl compiler

TypeDecl::impl_head

pub fn impl_head(string bound) -> Code
Import
use macro::{TypeDecl};
Source: compiler/src/prelude/macro.hy

Head of an impl Trait for … for this type: Name, or for a generic type Name<T: bound, U: bound>, every type parameter bounded by bound ("Show", "Ord + Eq"). Write impl ${trait} for ${t.impl_head("Show")} so a derive covers generic types too.

Called on a TypeDecl value as value.impl_head(…).

Parameters#

NameType
boundstring

Returns#

Code

See also#

↑ ↓ navigate ↵ open