pub struct TrackedChange {
pub id: String,
pub change_type: ChangeType,
pub block_ref: String,
pub before: Option<Box<Block>>,
pub after: Option<Box<Block>>,
pub range: Option<TextRange>,
pub original_text: Option<String>,
pub new_text: Option<String>,
pub author: Collaborator,
pub timestamp: DateTime<Utc>,
pub status: ChangeStatus,
pub note: Option<String>,
}Expand description
A tracked change in the document.
Fields§
§id: StringUnique identifier.
change_type: ChangeTypeType of change.
block_ref: StringReference to the affected block.
before: Option<Box<Block>>Content before the change (for modify/delete).
after: Option<Box<Block>>Content after the change (for insert/modify).
range: Option<TextRange>Text range affected (for inline changes).
original_text: Option<String>Original text (for inline changes).
new_text: Option<String>New text (for inline changes).
Author of the change.
timestamp: DateTime<Utc>When the change was made.
status: ChangeStatusCurrent status of the change.
note: Option<String>Optional note or reason for the change.
Implementations§
Source§impl TrackedChange
impl TrackedChange
Sourcepub fn new(
id: impl Into<String>,
change_type: ChangeType,
block_ref: impl Into<String>,
author: Collaborator,
) -> Self
pub fn new( id: impl Into<String>, change_type: ChangeType, block_ref: impl Into<String>, author: Collaborator, ) -> Self
Create a new tracked change.
Sourcepub fn insert(
id: impl Into<String>,
block_ref: impl Into<String>,
author: Collaborator,
content: Block,
) -> Self
pub fn insert( id: impl Into<String>, block_ref: impl Into<String>, author: Collaborator, content: Block, ) -> Self
Create an insertion change.
Sourcepub fn delete(
id: impl Into<String>,
block_ref: impl Into<String>,
author: Collaborator,
content: Block,
) -> Self
pub fn delete( id: impl Into<String>, block_ref: impl Into<String>, author: Collaborator, content: Block, ) -> Self
Create a deletion change.
Sourcepub fn modify(
id: impl Into<String>,
block_ref: impl Into<String>,
author: Collaborator,
before: Block,
after: Block,
) -> Self
pub fn modify( id: impl Into<String>, block_ref: impl Into<String>, author: Collaborator, before: Block, after: Block, ) -> Self
Create a modification change.
Sourcepub fn inline_text(
id: impl Into<String>,
block_ref: impl Into<String>,
author: Collaborator,
range: TextRange,
original: impl Into<String>,
replacement: impl Into<String>,
) -> Self
pub fn inline_text( id: impl Into<String>, block_ref: impl Into<String>, author: Collaborator, range: TextRange, original: impl Into<String>, replacement: impl Into<String>, ) -> Self
Create an inline text change.
Sourcepub fn with_before(self, block: Block) -> Self
pub fn with_before(self, block: Block) -> Self
Set the before state.
Sourcepub fn with_after(self, block: Block) -> Self
pub fn with_after(self, block: Block) -> Self
Set the after state.
Sourcepub fn with_range(self, range: TextRange) -> Self
pub fn with_range(self, range: TextRange) -> Self
Set the text range.
Sourcepub fn with_text_change(
self,
original: impl Into<String>,
new: impl Into<String>,
) -> Self
pub fn with_text_change( self, original: impl Into<String>, new: impl Into<String>, ) -> Self
Set inline text change.
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if this change is pending.
Trait Implementations§
Source§impl Clone for TrackedChange
impl Clone for TrackedChange
Source§fn clone(&self) -> TrackedChange
fn clone(&self) -> TrackedChange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrackedChange
impl Debug for TrackedChange
Source§impl<'de> Deserialize<'de> for TrackedChange
impl<'de> Deserialize<'de> for TrackedChange
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
Source§impl PartialEq for TrackedChange
impl PartialEq for TrackedChange
Source§impl Serialize for TrackedChange
impl Serialize for TrackedChange
impl StructuralPartialEq for TrackedChange
Auto Trait Implementations§
impl Freeze for TrackedChange
impl RefUnwindSafe for TrackedChange
impl Send for TrackedChange
impl Sync for TrackedChange
impl Unpin for TrackedChange
impl UnsafeUnpin for TrackedChange
impl UnwindSafe for TrackedChange
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