pub struct TypedPath {
pub link_type: ScopedLinkType,
pub path: Path,
}
Expand description
Fields§
§link_type: ScopedLinkType
The LinkType
within the scope of the zome where it’s defined.
path: Path
Implementations§
source§impl TypedPath
impl TypedPath
sourcepub fn new(link_type: impl Into<ScopedLinkType>, path: Path) -> Self
pub fn new(link_type: impl Into<ScopedLinkType>, path: Path) -> Self
sourcepub fn exists(&self) -> ExternResult<bool>
pub fn exists(&self) -> ExternResult<bool>
Does an entry exist at the hash we expect?
sourcepub fn ensure(&self) -> ExternResult<()>
pub fn ensure(&self) -> ExternResult<()>
Recursively touch this and every parent that doesn’t exist yet.
sourcepub fn parent(&self) -> Option<Self>
pub fn parent(&self) -> Option<Self>
The parent of the current path is simply the path truncated one level.
sourcepub fn children(&self) -> ExternResult<Vec<Link>>
pub fn children(&self) -> ExternResult<Vec<Link>>
Touch and list all the links from this path to paths below it. Only returns links between paths, not to other entries that might have their own links.
sourcepub fn children_paths(&self) -> ExternResult<Vec<Self>>
pub fn children_paths(&self) -> ExternResult<Vec<Self>>
Touch and list all the links from this path to paths below it.
Same as Path::children
but returns Vec<Path>
rather than Vec<Link>
.
This is more than just a convenience. In general it’s not possible to
construct a full Path
from a child Link
alone as only a single
Component
is encoded into the link tag. To build a full child path
the parent path + child link must be combined, which this function does
to produce each child, by using &self
as that parent.
pub fn children_details(&self) -> ExternResult<LinkDetails>
Methods from Deref<Target = Path>§
sourcepub fn path_entry_hash(&self) -> ExternResult<EntryHash>
pub fn path_entry_hash(&self) -> ExternResult<EntryHash>
What is the hash for the current Path
?