pub struct SyncHistoryEntry {
pub sync_id: String,
pub peer_pubkey: PublicKey,
pub tree_id: ID,
pub started_at: String,
pub completed_at: String,
pub success: bool,
pub entries_count: u64,
pub bytes_transferred: u64,
pub duration_ms: f64,
pub error_message: Option<String>,
}Expand description
Record of a single sync operation for audit and debugging purposes.
Fields§
§sync_id: StringUnique ID for this sync operation
peer_pubkey: PublicKeyThe peer involved in this sync
tree_id: IDThe tree that was synchronized
started_at: StringTimestamp when sync started
completed_at: StringTimestamp when sync completed (or failed)
success: boolWhether the sync was successful
entries_count: u64Number of entries synchronized
bytes_transferred: u64Estimated bytes transferred
duration_ms: f64Duration in milliseconds
error_message: Option<String>Error message if sync failed
Implementations§
Source§impl SyncHistoryEntry
impl SyncHistoryEntry
Sourcepub fn new(peer_pubkey: PublicKey, tree_id: ID, clock: &dyn Clock) -> Self
pub fn new(peer_pubkey: PublicKey, tree_id: ID, clock: &dyn Clock) -> Self
Create a new sync history entry.
§Arguments
peer_pubkey- The peer’s public keytree_id- The tree that was synchronizedclock- The time provider for timestamps
Sourcepub fn complete_success(
&mut self,
entries_count: u64,
bytes: u64,
clock: &dyn Clock,
)
pub fn complete_success( &mut self, entries_count: u64, bytes: u64, clock: &dyn Clock, )
Mark the sync as completed successfully.
§Arguments
entries_count- Number of entries syncedbytes- Estimated bytes transferredclock- The time provider for timestamps
Sourcepub fn complete_failure(&mut self, error: String, clock: &dyn Clock)
pub fn complete_failure(&mut self, error: String, clock: &dyn Clock)
Mark the sync as failed.
§Arguments
error- Error message describing the failureclock- The time provider for timestamps
Trait Implementations§
Source§impl Clone for SyncHistoryEntry
impl Clone for SyncHistoryEntry
Source§fn clone(&self) -> SyncHistoryEntry
fn clone(&self) -> SyncHistoryEntry
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 SyncHistoryEntry
impl Debug for SyncHistoryEntry
Source§impl<'de> Deserialize<'de> for SyncHistoryEntry
impl<'de> Deserialize<'de> for SyncHistoryEntry
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 SyncHistoryEntry
impl PartialEq for SyncHistoryEntry
Source§impl Serialize for SyncHistoryEntry
impl Serialize for SyncHistoryEntry
impl StructuralPartialEq for SyncHistoryEntry
Auto Trait Implementations§
impl Freeze for SyncHistoryEntry
impl RefUnwindSafe for SyncHistoryEntry
impl Send for SyncHistoryEntry
impl Sync for SyncHistoryEntry
impl Unpin for SyncHistoryEntry
impl UnwindSafe for SyncHistoryEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more