#[target]Expand description
Define a trait for use of implement macro.
§Arguments (all optional)
-
alternative… Trait. If specified, implement this trait instead of the target trait itself. The target trait is used only for an argument ofimplementmacro. See implementation oftraits. -
newer_type… Set path tonewer_typecrate. Defaults to::newer_type. Example:::your_crate::_export::newer_type.§Example
use newer_type::target; #[target] trait MyTrait { fn my_fn(&self) -> ::core::primitive::usize; }use newer_type::target; type TypeFromContext = usize; #[target] trait MyTrait { fn my_fn(&self, t: TypeFromContext) -> Box<usize>; }