txt: ## mixin.md
  mixin
  
  Combined from primary sources listed below.
  
  # [In role Metamodel::Mixins](#___top "go to top of document")[§](#(role_Metamodel::Mixins)_method_mixin "direct link")
  
  See primary documentation
  [in context](/type/Metamodel/Mixins#method_mixin)
  for **method mixin**.
  
  ```raku
  method mixin($obj, *@roles, :$needs-mixin-attribute)
  ```
  
  Generates a new mixin type by calling `generate_mixin` with `$obj` and `@roles`. If `$obj` is composed, the mixin cache of `$obj` will be checked for any existing mixin for these beforehand. If `$obj` is an instance of a type, this will return `$obj` reblessed with the mixin generated, otherwise this will return the mixin itself.
  
  If `$needs-mixin-attribute` is `True`, this will throw an exception if no mixin attribute exists on the mixin generated before returning.
  