#[non_exhaustive]pub struct NoteListing {
pub path: String,
pub size_bytes: u64,
pub modified_ms: Option<u64>,
}Expand description
A note’s identity and change-detection metadata, without its content.
This is what makes reconciliation affordable. A consumer maintaining
derived state stores (size_bytes, modified_ms) alongside each entry and
re-reads only the notes whose values moved — one stat per note instead of
one full read per note, which is the difference between a few milliseconds
and a full corpus scan on a large vault.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: StringVault-relative path using / separators.
size_bytes: u64Size in bytes when the vault was scanned.
modified_ms: Option<u64>Last-modified time as Unix epoch milliseconds, when the platform reports one.
Treat this as a change hint, not a clock: filesystems vary in
resolution and a restored file can carry an older timestamp than the
content it replaced. Pair it with size_bytes, and fall back to a
version comparison when correctness matters more than the extra read.
Implementations§
Source§impl NoteListing
impl NoteListing
Sourcepub fn new(
path: impl Into<String>,
size_bytes: u64,
modified_ms: Option<u64>,
) -> Self
pub fn new( path: impl Into<String>, size_bytes: u64, modified_ms: Option<u64>, ) -> Self
Construct a listing entry.
Sourcepub fn looks_unchanged_from(&self, previous: &Self) -> bool
pub fn looks_unchanged_from(&self, previous: &Self) -> bool
Whether this entry looks unchanged from a previously recorded one.
A cheap pre-filter, not proof: equal size and timestamp are strong evidence nothing happened, but a same-size edit within one timestamp tick is invisible here. Consumers that cannot tolerate a missed change should combine this with the event feed, which reports the write regardless.
Trait Implementations§
Source§impl Clone for NoteListing
impl Clone for NoteListing
Source§fn clone(&self) -> NoteListing
fn clone(&self) -> NoteListing
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NoteListing
impl Debug for NoteListing
Source§impl<'de> Deserialize<'de> for NoteListing
impl<'de> Deserialize<'de> for NoteListing
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>,
impl Eq for NoteListing
Source§impl PartialEq for NoteListing
impl PartialEq for NoteListing
Source§impl Serialize for NoteListing
impl Serialize for NoteListing
impl StructuralPartialEq for NoteListing
Auto Trait Implementations§
impl Freeze for NoteListing
impl RefUnwindSafe for NoteListing
impl Send for NoteListing
impl Sync for NoteListing
impl Unpin for NoteListing
impl UnsafeUnpin for NoteListing
impl UnwindSafe for NoteListing
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.