This document helps with migration to newer versions of
This document will not be exhaustive.
Rather, it will focus on highlights or "must know" items.
Regarding breaking changes:
- This document will discuss breaking changes requiring change in client code.
- Other changes listed in the change log as breaking are considered "technically breaking but unlikely to affect anyone in practice". Please file an issue if we are wrong!
- UB = undefined behavior.
- Provenance table getters now return
Option<String>. These two types are very close to identical in API. Breakage is only possible if code relied on the return value owning its data.
- Several member functions of Tree previously accepted
NodeIdas arguments. They now take
N: Into<NodeId> + Copy. Thus, code passing in integers will have to drop the
- Tree functions returning iterators previously returned
Option<Iterator<...>>. They now return
Iterator<...>. Data leading to
Nonebeing returned in previous versions now return an iterator that will end immediately.
TableViewswas replaced with delegation because using
Derefto model inheritance is an anti-pattern.
SizeTypeconversions are now fallible (e.g.,
TskitTypeAccesstrait was removed because it was a bad idea. (It makes no sense to be generic over returning pointers to low-level tskit types.) The functionality is replaced with
- The names of all
Ownedtables are now
Send + Sync.
- Issue 363, which was introduced in PR 300. The bug resulted in UB when advancing trees for release builds.
The error enum now includes
Any code previously matching on errors will now break because the match is no longer exhaustive.
This change occurred over several PR.
All "getter" functions for table rows now return
Option instead of
Result when a row index is out of bounds.
These functions now return
None for the out of bounds case.
This behavior change brings the API in line with other rust APIs.
Noneshould represent an error for your use case, use
Option::ok_or_else. In the case of a previous
Result<Option<_>, _>that is now an
Option<Result<_, _>>, use
Previously, a non-owning view of an edge table had a type
Those lifetimes are no longer necessary, which is a big design win.
NodeListRowGenerator, have been removed.
TreeSequence types now contain that functionality as
Removing these traits implies:
- Their removal from the crate prelude.
- They can no longer be used as trait bounds.
Some views of a node table that required mutability broke due to these changes.
A new function in the
Deref target is
nodes_mut(&mut self) addresses this breakage.