Skip to main content

java_diff_utils_rs/patch/
verify_chunk.rs

1use std::fmt;
2
3/// Represents the result status when verifying a chunk against a target sequence.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
5pub enum VerifyChunk {
6    /// The chunk matches the target sequence at the specified position.
7    Ok,
8    /// The specified position or range lies outside the boundaries of the target sequence.
9    PositionOutOfTarget,
10    /// The target sequence content does not match the chunk's expected lines.
11    ContentDoesNotMatchTarget,
12}
13
14impl fmt::Display for VerifyChunk {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        match self {
17            Self::Ok => write!(f, "OK"),
18            Self::PositionOutOfTarget => write!(f, "POSITION_OUT_OF_TARGET"),
19            Self::ContentDoesNotMatchTarget => write!(f, "CONTENT_DOES_NOT_MATCH_TARGET"),
20        }
21    }
22}