part of '../persistence.dart'; /// Minimal Either type for expected repository success/failure paths. sealed class Either { const Either(); /// Whether this value is a left/failure value. bool get isLeft => this is Left; /// Whether this value is a right/success value. bool get isRight => this is Right; /// Return the left value or throw when this is right. L get left => switch (this) { Left(:final value) => value, Right() => throw StateError('Either does not contain left.'), }; /// Return the right value or throw when this is left. R get right => switch (this) { Left() => throw StateError('Either does not contain right.'), Right(:final value) => value, }; }