You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/new-version.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,7 +212,7 @@ impl From<MyType> for v1::path::MyType {
212
212
// above.
213
213
```
214
214
215
-
In general, there is no need to implement conversions from other prior versions, since you can go through intermediate versions. In some cases it may be more efficient to do so anyway; use appropriate judgment.
215
+
In general, don't add `From` impls from other prior versions. (So, if a type changed from `v1`to `v4` to `v9`, avoid implementing conversions from `v9` to `v1` or vice versa.) Instead, hop through intermediate versions in the API trait. In some cases it may be more efficient to have direct conversions to prior versions; use appropriate judgment.
216
216
217
217
### Add or update re-exports in `latest.rs`
218
218
@@ -338,6 +338,60 @@ pub trait MyApi {
338
338
339
339
If possible (particularly if conversions only use `From` or `TryFrom`), make the prior version a provided method on the trait, with a default implementation that forwards to the corresponding latest versions. See [RFD 619's example API trait](https://rfd.shared.oxide.computer/rfd/619#example-api-trait).
340
340
341
+
Update changed endpoints to hop through intermediate versions if necessary. For example:
0 commit comments