# Declare and Implement Extension Trait Once

**URL:** <https://internals.rust-lang.org/t/declare-and-implement-extension-trait-once/18500>\
**Category:** language design\
**Created:** [March 9, 2023, 12:11am UTC](https://internals.rust-lang.org/t/declare-and-implement-extension-trait-once/18500 "2023-03-09T00:11:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cuviper](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/cuviper/32/1897_2.png) [@cuviper](https://internals.rust-lang.org/u/cuviper)\
**Post date:** [March 9, 2023, 12:22am UTC](https://internals.rust-lang.org/t/declare-and-implement-extension-trait-once/18500/2 "2023-03-09T00:22:18Z")

</div>

Here's a previous thread:

> [@Idea: Trait+Impl Item for ergonomic extension traits](https://internals.rust-lang.org/t/idea-trait-impl-item-for-ergonomic-extension-traits/12891):
>
> Occasionally one wants to create effectively inherent methods on foreign types for usage within their crate. When you do this, you have to define both a trait and an impl. All of the contents of the trait are just type signatures for the functions and then the impl contains the same type signatures but with an actual body. For example, say I want to add a method foo() to Option\<MyType\> to automatically create a new MyType if it's None and then call the method foo() on MyType. We have to write th…

---

_[View the full topic](https://internals.rust-lang.org/t/declare-and-implement-extension-trait-once/18500)._
