diff options
Diffstat (limited to 'lib/btrfs')
-rw-r--r-- | lib/btrfs/btrfsvol/addr.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/btrfs/btrfsvol/addr.go b/lib/btrfs/btrfsvol/addr.go index 76b531d..94320ef 100644 --- a/lib/btrfs/btrfsvol/addr.go +++ b/lib/btrfs/btrfsvol/addr.go @@ -56,3 +56,13 @@ func (a QualifiedPhysicalAddr) Cmp(b QualifiedPhysicalAddr) int { } return int(a.Addr - b.Addr) } + +type _IntAddr[T any] interface { + ~int64 + Sub(T) AddrDelta + Add(AddrDelta) T +} + +// IntAddr is a type constraint that you can use to accept LogicalAddr +// or PhysicalAddr. +type IntAddr[T _IntAddr[T]] _IntAddr[T] |