Skip to main content

revault_lockbox_api/model/
entry.rs

1/// Kind of logical node returned by lockbox listing and stat APIs.
2#[derive(Debug, Clone, PartialEq, Eq)]
3pub enum LockboxEntryKind {
4    /// Regular file content.
5    File,
6    /// Symbolic link record.
7    Symlink,
8    /// Directory record.
9    Directory,
10}
11
12/// Metadata returned by lockbox listing and stat APIs.
13///
14/// This type contains only metadata stored in the table of contents. Symlink
15/// targets are stored in symlink page objects, so callers that need a target
16/// should call `Lockbox::get_symlink_target` for symlink entries.
17#[derive(Debug, Clone, PartialEq, Eq)]
18pub struct LockboxEntry {
19    /// Canonical logical path inside the lockbox.
20    pub path: LockboxPath,
21    /// Node kind.
22    pub kind: LockboxEntryKind,
23    /// File length in bytes. Symlink and directory entries report zero.
24    pub len: u64,
25    /// Stored Unix-style permission bits.
26    pub permissions: u32,
27}
28use crate::LockboxPath;