Skip to main content

ot_rs/core/
error.rs

1/// 定义 OT 算法的一些异常
2#[derive(Debug, PartialEq, Eq)]
3pub enum OperationError {
4    /// The operation's base length must be equal to the string's length.
5    /// 操作的 base length 必须等于 base 字符串的长度
6    OperationApplyStringNotCompatible,
7    /// Operation can't retain more characters than are left in the string.
8    /// 操作长度不能超过剩余的字符字符串长度
9    OperationMoreLeftString,
10    // /// The operation didn't operate on the whole string.
11    // /// 操作不能覆盖整个字符串
12    // OperationNotCoverWholeString,
13    /// The base length of the second operation has to be the target length of the first operation
14    /// 第二个的 base length 不等于第一个的 target length
15    SecondBaseLengthNotEqualFirstAfterLength,
16    /// compose operations: first operation is too short.
17    /// 组合操作:第一个操作太短
18    ComposeFirstTooShort,
19    /// compose operations: first operation is too long.
20    /// 组合操作:第一个操作太长
21    ComposeFirstTooLong,
22    // /// This shouldn't happen
23    // /// 这种情况不应该发生
24    // ComposeShouldNotHappen(String),
25    /// Both operations have to have the same base length
26    /// 两个操作必须具有相同的 base length
27    TransformBaseDifferent,
28    /// The two operations aren't compatible
29    /// 两个操作并不兼容
30    TransformNotCompatible,
31}