A block, an IPNS record, etc.
More...
#include <library/include/ipfs_client/ipld/dag_node.h>
|
static NodePtr | fromBytes (std::shared_ptr< Client > const &api, Cid const &, ByteView bytes) |
|
static NodePtr | fromBytes (std::shared_ptr< Client > const &api, Cid const &, std::string_view bytes) |
|
static NodePtr | fromBlock (PbDag const &) |
|
|
ResolveResult | CallChild (ResolutionState &) |
| As before, but it might be possible to create on the fly if not known.
|
|
ResolveResult | CallChild (ResolutionState &, std::function< NodePtr(std::string_view)> gen_child) |
|
ResolveResult | CallChild (ResolutionState &, std::string_view link_key) |
| Add the link if not present, then CallChild(ResolutionState)
|
|
ResolveResult | CallChild (ResolutionState &, std::string_view link_key, std::string_view block_key) |
|
A block, an IPNS record, etc.
◆ CallChild()
auto Node::CallChild |
( |
ResolutionState & |
state, |
|
|
std::function< NodePtr(std::string_view)> |
gen_child |
|
) |
| |
|
protected |
When the child's name is not the next element in the path, but it must be known about. e.g. index.html for a path ending in a directory
◆ deroot()
- Returns
- *this if it's not a Root, otherwise its child
◆ expired()
auto Node::expired |
( |
| ) |
const |
|
virtual |
◆ PreferOver()
auto Node::PreferOver |
( |
DagNode const & |
another | ) |
const |
|
virtual |
- Returns
- Whether this is a "better"/more-up-to-date replacement
- Parameters
-
another | The node to compare to. |
◆ Resolve()
Query the DAG
- Parameters
-
params | Information about what you're looking for |
- Returns
- The data needed or how to get it or some additional info needed before asking again.
◆ rooted()
Get a root node that is logically this node
- Returns
- this iff this is of type ipfs::ipld::Root Otherwise a Root that has this as a child.
◆ set_api()
void Node::set_api |
( |
std::shared_ptr< Client > |
api | ) |
|
Provide the Client API to be used in DAG operations
- Parameters
-
api | Shared pointer to API for the context being run in |
◆ api_
std::shared_ptr<Client> ipfs::ipld::DagNode::api_ |
|
protected |
When the next path element is what's needed, and it should already be a link known about...
◆ links_
std::vector<std::pair<std::string, Link> > ipfs::ipld::DagNode::links_ |
|
protected |
The child nodes of this node, possibly not yet fetched.
- Note
- In some cases the string is empty. For example as stem node of a UnixFS (multi-node) file.
The documentation for this class was generated from the following files:
- library/include/ipfs_client/ipld/dag_node.h
- library/src/ipfs_client/ipld/dag_node.cc