pub unsafe trait TidAble<'a>: Tid<'a> { }
Expand description

This trait indicates that you can substitute this type as a type parameter to another type so that resulting type could implement Tid.

So if you don’t have such generic types, just use Tid everywhere, you don’t need to use this trait at all.

Only this trait is actually being implemented on user side. Other traits are mostly just blanket implementations over X:TidAble<’a>

Note that this trait interferes with object safety, so you shouldn’t use it as a super trait if you are going to make a trait object. Formally it is still object safe, but you can’t make a trait object from it without specifying internal associate type like: dyn TidAble<'a,Static=SomeType> which make such trait object effectively useless.

Unsafe because safety of this crate relies on correctness of this trait implementation. There are several safe ways to implement it:

  • type_id/tid declarative macro
  • #[derive(Tid)] derive macro
  • impl_tid` attribute macro

Implementations on Foreign Types