pub struct FileTreeNodeId(/* private fields */);Expand description
Opaque, monotone identity allocated by one FileTreeStore.
IDs are meaningful only within the store that allocated them, are never
reused, and may refer to a removed/reserved node. The initial root is 1.
Derived deserialization accepts every u64, including 0 and IDs no store
allocated; always validate a deserialized ID by querying its intended store.
§Examples
use ailloli_ui_fs::{FileKind, FileMetadata, FileTreeStore, FileUri};
let store = FileTreeStore::new(FileUri::parse("file:///")?, FileMetadata::new(FileKind::Directory))?;
assert_eq!(store.root().get(), 1);Implementations§
Source§impl FileTreeNodeId
impl FileTreeNodeId
Sourcepub const fn get(self) -> u64
pub const fn get(self) -> u64
Returns the store-local numeric representation.
§Examples
use ailloli_ui_fs::{FileKind, FileMetadata, FileTreeStore, FileUri};
let store = FileTreeStore::new(FileUri::parse("file:///")?, FileMetadata::new(FileKind::Directory))?;
let raw: u64 = store.root().get();
assert_eq!(raw, 1);Trait Implementations§
Source§impl Clone for FileTreeNodeId
impl Clone for FileTreeNodeId
Source§fn clone(&self) -> FileTreeNodeId
fn clone(&self) -> FileTreeNodeId
Returns a copy 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 FileTreeNodeId
impl Debug for FileTreeNodeId
Source§impl<'de> Deserialize<'de> for FileTreeNodeId
impl<'de> Deserialize<'de> for FileTreeNodeId
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 Hash for FileTreeNodeId
impl Hash for FileTreeNodeId
Source§impl PartialEq for FileTreeNodeId
impl PartialEq for FileTreeNodeId
Source§impl Serialize for FileTreeNodeId
impl Serialize for FileTreeNodeId
impl Copy for FileTreeNodeId
impl Eq for FileTreeNodeId
impl StructuralPartialEq for FileTreeNodeId
Auto Trait Implementations§
impl Freeze for FileTreeNodeId
impl RefUnwindSafe for FileTreeNodeId
impl Send for FileTreeNodeId
impl Sync for FileTreeNodeId
impl Unpin for FileTreeNodeId
impl UnwindSafe for FileTreeNodeId
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