Crates.io | hc_utils |
lib.rs | hc_utils |
version | 0.4.0-dev.17.hotfix-1 |
source | src |
created_at | 2021-09-30 19:30:21.784348 |
updated_at | 2024-09-19 22:59:23.80694 |
description | Helper functions for holochain hdk development |
homepage | https://github.com/holochain/hc-utils |
repository | |
max_upload_size | |
id | 458846 |
size | 23,549 |
A util crate for holochain-rsm
Note: Currently the hc-utils crate will always follow the version of hdk, when hdk version is 1.2.1, hc_utils version will be v1.2.1
Note: all the functions are converted to macros
Query for an existing Entry in the local source-chain matching the given EntryType name(s). If one exists, return it Address, otherwise commit it.
Query for an existing Link in the local source-chain matching the given LinkType name(s). If one exists, return it Address, otherwise commit it.
Query for an existing Entry in the local source-chain matching the given EntryType name(s). If one exists, return it Address, otherwise returns error
Gets the action of an Entry
Obtains the updates for the target Entry, and examines all of them to selects the latest one by looking at the update time in its action.
An identical Entry can be committed by multiple Agents; this obtains the Entry's Action from the perspective of _this_ Agent. It also may be committed by the same Agent multiple times, this algorithm depends on either making the Entry unique, _or_ that the caller is OK with it returning the latest Update by any of this Agent's commits of this identical Entry.
gets latest link created to the specific base
Returns a list of elements from the local source-chain
Removes link. The current hdk expects you to get all links and delete_link by specifying the entry_hash of the entry that you want to delete
String wrapper for all holo_hash types
Get details for a list of links passed using the HDK::borrow functions
Get element for a list of links passed using the HDK::borrow functions
Gets the entries that are linked to a base with LinkTag by matching with the declared TryFrom Entry.
**Macros:**
- `get_links_and_load_type!(base, tag)`
- `include_latest_updated_entry = true` is used when an entry is updated in the zome and if you need the latest update of those entries
- `get_links_and_load_type!(base, tag, false)`
- `include_latest_updated_entry = false` is used when an entry does not have updates.
Map versions:
hc-utils | hdk |
---|---|
v0.0.107 | v0.0.107 |
v0.0.110 | v0.0.110 |
... | ... |
v0.0.111 | v0.0.111 |
v0.0.115 | v0.0.115 |
Copyright (C) 2017-2020, Holo Ltd.
This program is free software: you can redistribute it and/or modify it under the terms of the license provided in the LICENSE file (CAL-1.0). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.