#[non_exhaustive]pub struct FileNode {Show 18 fields
pub id: Id,
pub parent_id: Option<Id>,
pub node_type: Option<NodeType>,
pub blob_id: Option<Id>,
pub target: Option<Vec<String>>,
pub size: Option<u64>,
pub name: String,
pub media_type: Option<String>,
pub created: Option<UTCDate>,
pub modified: Option<UTCDate>,
pub accessed: Option<UTCDate>,
pub changed: Option<UTCDate>,
pub executable: Option<bool>,
pub is_subscribed: Option<bool>,
pub my_rights: Option<FilesRights>,
pub share_with: Option<HashMap<Id, FilesRights>>,
pub role: Option<NodeRole>,
pub extra: Map<String, Value>,
}Expand description
A JMAP FileNode object (draft-ietf-jmap-filenode-13 §3.1).
§Nullable vs optional fields
Several fields are required-but-nullable: they MUST appear in the wire JSON
even when their value is null. These use Option<T> with NO
skip_serializing_if, so serde emits "field":null.
Other fields are truly optional: absent from the wire when not set by the
client or server. These use #[serde(skip_serializing_if = "Option::is_none")].
Nullable (must appear as null) | Optional (absent when None) |
|---|---|
parent_id, blob_id, target, size, media_type, share_with, role | node_type, created, modified, accessed, changed, executable, is_subscribed, my_rights |
§modified and accessed semantics
Both are client-managed. The server does NOT automatically update them on change.
Setting either to null in an update (None after deserialization) signals the
server to reset it to the current time. This differs from changed, which the
server sets automatically and clients cannot set.
§share_with visibility
shareWith is null when the requesting user lacks myRights.mayShare or the
node is not shared with anyone.
§blob_id lifetime guarantee
A blob referenced by a FileNode MUST NOT be garbage-collected by the server while the FileNode exists (§3.1). The server backend must enforce this invariant.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: IdServer-assigned immutable identifier.
parent_id: Option<Id>Id of the parent node, or null if this is a top-level node.
Required-and-nullable: always present in wire JSON (as null or an Id string).
node_type: Option<NodeType>The type of node. Immutable after creation.
If absent on creation the server infers: "file" if blobId is non-null,
"symlink" if target is non-null, "directory" otherwise.
blob_id: Option<Id>The blobId for the file content.
Required-and-nullable: always present in wire JSON. MUST be non-null for file nodes, null for directory and symlink nodes.
target: Option<Vec<String>>Symlink target as an array of path elements.
Required-and-nullable: always present in wire JSON. MUST be non-null for symlink nodes, null for file and directory nodes.
size: Option<u64>Size in bytes of the associated blob data (server-set).
Required-and-nullable: always present in wire JSON. MUST be null for directory and symlink nodes, non-null for file nodes.
name: StringUser-visible name for the FileNode. Net-Unicode, at least 1 character.
media_type: Option<String>The media type (IANA) of the FileNode.
Required-and-nullable: always present in wire JSON.
Wire field name is literally "type" (a Rust keyword).
MUST be non-null for file nodes, null for directory and symlink nodes.
created: Option<UTCDate>The date the node was created.
Default: current server time. Absent from wire when None.
Uses the UTCDate newtype to make the wire-format constraint
(RFC 8620 §1.4: 20-character UTCDateTime string) explicit at the
type level. JSON wire format is unchanged because UTCDate is a
transparent newtype around String.
modified: Option<UTCDate>The date the node was last updated, client-managed.
Setting to null in an update signals the server to reset to the current time.
The server does NOT auto-update this value. Absent from wire when None.
See created for the typing rationale.
accessed: Option<UTCDate>The date the node was last accessed, client-managed.
Setting to null in an update signals the server to reset to the current time.
The server does NOT auto-update this value. Absent from wire when None.
See created for the typing rationale.
changed: Option<UTCDate>The date the server last recorded a change to any property (server-set).
Automatically updated on every mutation. Not settable by clients.
Absent from wire when None.
Uses the UTCDate newtype to make the wire-format constraint
(RFC 8620 §1.4: 20-character UTCDateTime string) explicit at the
type level. JSON wire format is unchanged because UTCDate is a
#[serde(transparent)] newtype around String.
executable: Option<bool>If true, the node should be treated as executable. Default: false.
Absent from wire when None.
is_subscribed: Option<bool>Whether the current user is subscribed to this node. Default: true.
Per-user property. Absent from wire when None.
my_rights: Option<FilesRights>ACL rights the authenticated user holds for this node (server-set).
Absent from wire when None.
Map of userId → rights for users this node is shared with.
Required-and-nullable: always present in wire JSON.
null when the requesting user lacks myRights.mayShare or the node is
not shared.
role: Option<NodeRole>Special role identifying this directory’s purpose.
Required-and-nullable (draft §3.1 type: String|null): always present
in wire JSON; serializes as null when unset. MUST be null for
file nodes.
extra: Map<String, Value>Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).