pub struct Change {
pub id: String,
pub timestamp: DateTime<Utc>,
pub file_path: String,
pub before: String,
pub after: String,
pub description: String,
pub change_type: ChangeType,
}Expand description
Represents a single modification to a file or system state
Fields§
§id: StringUnique identifier for this change
timestamp: DateTime<Utc>When the change occurred
file_path: StringPath to the modified file
before: StringState before the change
after: StringState after the change
description: StringHuman-readable description of the change
change_type: ChangeTypeType of change
Implementations§
Source§impl Change
impl Change
Sourcepub fn new(
file_path: impl Into<String>,
before: impl Into<String>,
after: impl Into<String>,
description: impl Into<String>,
change_type: ChangeType,
) -> Result<Self, UndoRedoError>
pub fn new( file_path: impl Into<String>, before: impl Into<String>, after: impl Into<String>, description: impl Into<String>, change_type: ChangeType, ) -> Result<Self, UndoRedoError>
Create a new change with automatic UUID and timestamp
Sourcepub fn validate(&self) -> Result<(), UndoRedoError>
pub fn validate(&self) -> Result<(), UndoRedoError>
Validate the change for consistency
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Change
impl<'de> Deserialize<'de> for Change
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnwindSafe for Change
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more