pub struct FsObjId { /* private fields */ }Expand description
Filesystem-scoped identifier for an underlying filesystem object.
This combines a filesystem ID and that filesystem’s file ID. It is suitable
for comparing objects reported by the same backend identity namespace; it
is not a global ID across servers or unrelated backend clients. IDs can be
reused after deletion, so this is not a durable globally unique identifier.
It does not identify an open instance; see crate::api::FileHandle for that.
Request both components before comparing underlying objects:
use vfsi_core::{api::AttrsOptions, AttrMask, FsObjId, VfResult, Vfsi, VfsiExt};
fn object_id<C: Vfsi>(fs: &C) -> VfResult<Option<FsObjId>> {
let attrs = fs.attrs_with_options(
"/file",
AttrsOptions::new().with_fields(AttrMask::identity()),
)?;
Ok(attrs.fs_obj_id())
}Implementations§
Source§impl FsObjId
impl FsObjId
Sourcepub const fn new(fs_id: u128, file_id: u64) -> FsObjId
pub const fn new(fs_id: u128, file_id: u64) -> FsObjId
Construct a pair obtained from one backend/server identity namespace. This does not make numeric IDs globally unique across unrelated servers.
Sourcepub const fn fs_id(self) -> u128
pub const fn fs_id(self) -> u128
Filesystem namespace component; Linux st_dev or packed NFS FSID. This is independent of the mount used to reach the object.
Sourcepub const fn file_id(self) -> u64
pub const fn file_id(self) -> u64
File-number component, meaningful within Self::fs_id and its
backend/server identity namespace (Linux st_ino or NFS FILEID).