Container for multiple bind mount configurations.
Manages a collection of Bind entries representing all bind mounts configured for a sandboxed application. Provides methods for adding, removing, and querying bind mounts. Supports serialization to and deserialization from JSON. Maintains index consistency automatically when entries are added or removed.
Definition at line 87 of file bind.hpp.
| void ns_db::ns_bind::Binds::erase |
( |
size_t | index | ) |
|
|
inline |
Removes a bind mount by its index.
Searches for and removes the bind mount with the specified index from the internal vector. After removal, reindexes all remaining bind mounts sequentially starting from 0 to maintain consistent indexing. Logs whether the element was found and removed or if no element with the given index existed.
- Parameters
-
| index | The zero-based index of the bind mount to remove |
Definition at line 145 of file bind.hpp.
| Value< Binds > deserialize |
( |
std::string_view | raw_json | ) |
|
|
friend |
Deserializes JSON string into a Binds object.
Parses a JSON string containing bind mount configurations and constructs a Binds object. Each JSON entry should have "src", "dst", and "type" fields. The type field must be "ro" (read-only), "rw" (read-write), or "dev" (device). Entries with invalid indices are logged as warnings and skipped. Successfully parsed entries are added to the Binds collection with their respective indices, source paths, destination paths, and access types.
- Parameters
-
| raw_json | The JSON string containing bind mount configurations |
- Returns
- Value<Binds> The deserialized Binds object on success, or error on parse failure
- Parameters
-
| str_raw_json | The json string which to deserialize |
- Returns
- The
Boot class or the respective error
- Parameters
-
| raw_json | The json string which to deserialize |
- Returns
- The
Desktop class or the respective error
- Parameters
-
| str_raw_json | The json string which to deserialize |
- Returns
- The
Logs class or the respective error
- Parameters
-
| str_raw_json | The json string which to deserialize |
- Returns
- The
Daemon class or the respective error
- Parameters
-
| str_raw_json | The json string which to deserialize |
- Returns
- The
Dispatcher class or the respective error
- Parameters
-
| str_raw_json | The json string which to deserialize |
- Returns
- The
Message class or the respective error
- Parameters
-
| raw_json | The json string which to deserialize |
- Returns
- The
Recipe class or the respective error
Definition at line 184 of file bind.hpp.