Skip to content

ludus::foundation::filesystem::MountSnapshot

Ludus Wiki · API overview · Browse API

Class

Immutable, shared read mount table. The host publishes/replaces handles at its own synchronization boundary; no global namespace, implicit writer or live-table mutation. Concurrent const lookups are supported while their handle remains alive.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

#include <ludus/foundation/filesystem/namespace.hpp>
class ludus::foundation::filesystem::MountSnapshot final

Methods

MountSnapshot

ludus::foundation::filesystem::MountSnapshot::MountSnapshot() noexcept=default
Creates an invalid snapshot; use Create even for an empty table.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

~MountSnapshot

ludus::foundation::filesystem::MountSnapshot::~MountSnapshot() noexcept
Releases this reference; opened files retain their originating snapshot.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

MountSnapshot

ludus::foundation::filesystem::MountSnapshot::MountSnapshot(const MountSnapshot &other) noexcept
Retains the same snapshot without allocation.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

operator=

MountSnapshot & ludus::foundation::filesystem::MountSnapshot::operator=(const MountSnapshot &other) noexcept
Retains other and releases the previous snapshot; self-copy is supported.

Related types: MountSnapshot

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

MountSnapshot

ludus::foundation::filesystem::MountSnapshot::MountSnapshot(MountSnapshot &&other) noexcept
Transfers ownership, leaving other invalid.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

operator=

MountSnapshot & ludus::foundation::filesystem::MountSnapshot::operator=(MountSnapshot &&other) noexcept
Releases the previous snapshot and transfers other; self-move is supported.

Related types: MountSnapshot

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

IsValid

bool ludus::foundation::filesystem::MountSnapshot::IsValid() const noexcept
Returns whether Create succeeded, including an empty table.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

Generation

uint64 ludus::foundation::filesystem::MountSnapshot::Generation() const noexcept
Returns the host-assigned generation, or zero for an invalid handle.

Related types: uint64

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

Count

usize ludus::foundation::filesystem::MountSnapshot::Count() const noexcept
Returns the number of mounted providers.

Related types: usize

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

Describe

bool ludus::foundation::filesystem::MountSnapshot::Describe(usize index, MountInfo &output) const noexcept
Inspects one mount in resolution order; out-of-range failure preserves output.

Related types: usize · MountInfo

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

OpenRead

LookupResult ludus::foundation::filesystem::MountSnapshot::OpenRead(const VirtualPath &path, VirtualFile &output, std::span< MountAttempt > attempts={}) const noexcept
Resolves complete-component prefixes, stripping the prefix before provider lookup. An exact prefix has no file key and does not match. Only NotFound falls back. Failure preserves the opened output. Trace writes up to attempts.size() entries; LookupResult::Attempts reports all attempted providers. Unused trace slots are preserved.

Related types: VirtualFile · VirtualPath · LookupResult · MountAttempt

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

Static methods

Create

static Result ludus::foundation::filesystem::MountSnapshot::Create(std::span< const Mount > mounts, uint64 generation, MountSnapshot &output) noexcept
Copies prefixes and retains providers, sorting by descending priority then ascending ID. Invalid roots/prefixes, null providers, duplicate/zero IDs, zero generation or too many mounts return InvalidArgument. Allocation failure returns OutOfMemory. Failure preserves output; input may borrow from the previous output snapshot.

Related types: MountSnapshot · uint64 · Mount · Result

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp