pub struct OpenedFileInfo { /* private fields */ }Expand description
Stable file identity plus an optional metadata snapshot captured at open.
§Examples
use qubit_fs::metadata::{FileKind, FileMetadata, FileSystemId, OpenedFileInfo};
use qubit_fs::path::Path;
let info = OpenedFileInfo::new(FileSystemId::new("doc")?, Path::parse("/report")?)
.with_metadata(FileMetadata::new(FileKind::File));
assert_eq!("/report", info.path().as_str());Implementations§
Source§impl OpenedFileInfo
impl OpenedFileInfo
Sourcepub fn new(filesystem_id: FileSystemId, path: Path) -> Self
pub fn new(filesystem_id: FileSystemId, path: Path) -> Self
Sourcepub fn with_metadata(self, metadata: FileMetadata) -> Self
pub fn with_metadata(self, metadata: FileMetadata) -> Self
Sourcepub const fn filesystem_id(&self) -> &FileSystemId
pub const fn filesystem_id(&self) -> &FileSystemId
Sourcepub const fn path(&self) -> &Path
pub const fn path(&self) -> &Path
Returns the logical path fixed when the provider opened the handle.
Sourcepub fn metadata(&self) -> Option<&FileMetadata>
pub fn metadata(&self) -> Option<&FileMetadata>
Returns the optional metadata snapshot captured during open.
This is not live metadata. Call crate::FileSystem::stat when a
current view is required.
§Returns
The optional open-time snapshot.
Trait Implementations§
Source§impl Clone for OpenedFileInfo
impl Clone for OpenedFileInfo
Source§impl Debug for OpenedFileInfo
impl Debug for OpenedFileInfo
Source§impl PartialEq for OpenedFileInfo
impl PartialEq for OpenedFileInfo
impl StructuralPartialEq for OpenedFileInfo
Auto Trait Implementations§
impl Freeze for OpenedFileInfo
impl RefUnwindSafe for OpenedFileInfo
impl Send for OpenedFileInfo
impl Sync for OpenedFileInfo
impl Unpin for OpenedFileInfo
impl UnsafeUnpin for OpenedFileInfo
impl UnwindSafe for OpenedFileInfo
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