pub struct FileId(/* private fields */);Expand description
A stable file identity that persists across renames and moves (§5.8).
A FileId is assigned when a file is first created and never changes,
even if the file is renamed or moved. This makes rename-aware merge
possible without heuristics.
Internally stored as a u128 and serialized as a 32-character lowercase
hex string for canonical JSON.
Implementations§
Source§impl FileId
impl FileId
Sourcepub fn random() -> Self
pub fn random() -> Self
Generate a cryptographically-random FileId.
Uses the thread-local PRNG (rand 0.9). Each call produces a unique 128-bit random identifier suitable for stable file identity.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileId
impl<'de> Deserialize<'de> for FileId
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 Ord for FileId
impl Ord for FileId
Source§impl PartialOrd for FileId
impl PartialOrd for FileId
impl Copy for FileId
impl Eq for FileId
impl StructuralPartialEq for FileId
Auto Trait Implementations§
impl Freeze for FileId
impl RefUnwindSafe for FileId
impl Send for FileId
impl Sync for FileId
impl Unpin for FileId
impl UnsafeUnpin for FileId
impl UnwindSafe for FileId
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key and return true if they are equal.