/* * This source code is released into the public domain. */ module; #include #include import nihil; import nihil.ucl; export module liblfvm:serialize; import :context; import :vm_config; namespace lfvm { /* * Serialize a vm_config to a UCL string. */ export [[nodiscard]] auto serialize(vm_config const &) -> std::expected; /* * Deserialize a UCL string into a vm. */ export [[nodiscard]] auto deserialize(std::string_view) -> std::expected; /* * Load a VM from disk. */ export [[nodiscard]] auto vm_load(context const &, std::string_view name) -> std::expected; /* * Save a new VM to disk based on a config. */ export [[nodiscard]] auto vm_create(context const &, vm_config const &) -> std::expected; /* * Save an existing VM to disk. */ export [[nodiscard]] auto vm_save(context const &, vm_config const &) -> std::expected; /* * List existing VMs. */ export [[nodiscard]] auto vm_list(context const &) -> std::expected, nihil::error>; } // namespace lfvm