expected<ustore_collection_id_t> collection_named(
receiver_t const & receiver,
std::string_view name,
ustore_modality_t *modality = nullptr) noexcept; expected<ustore_collection_id_t> collection_named(
receiver_t const & receiver,
std::string_view name,
ustore_modality_t modality) noexcept; Reads the collection name was given, as the overload above, refusing one that holds another modality than modality.
Names resolve in two phases, so this is the only place a name reaches the database, and every other call addresses its collection by the identifier this returns.
Parameters
receiver | in | The receiver whose snapshot the name is read at, or the head when it names none. |
|---|---|---|
name | in | The collection's name. |
modality | out | What the collection holds, written when given. |
Statuses
status_code_t::not_found_kNo collection carriesname.status_code_t::invalid_argument_kThe collection holds another modality thanmodality.