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 data 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
?
Trait Implementations§
source§impl<'de> Deserialize<'de> for TypedPath
impl<'de> Deserialize<'de> for TypedPath
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for TypedPath
impl PartialEq for TypedPath
source§impl TryFrom<&TypedPath> for SerializedBytes
impl TryFrom<&TypedPath> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: &TypedPath) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &TypedPath) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<SerializedBytes> for TypedPath
impl TryFrom<SerializedBytes> for TypedPath
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(sb: SerializedBytes) -> Result<TypedPath, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<TypedPath, SerializedBytesError>
source§impl TryFrom<TypedPath> for SerializedBytes
impl TryFrom<TypedPath> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: TypedPath) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: TypedPath) -> Result<SerializedBytes, SerializedBytesError>
impl StructuralPartialEq for TypedPath
Auto Trait Implementations§
impl Freeze for TypedPath
impl RefUnwindSafe for TypedPath
impl Send for TypedPath
impl Sync for TypedPath
impl Unpin for TypedPath
impl UnwindSafe for TypedPath
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.