pub enum ResolvedNode {
Block(Block),
DagPbData(Cid, NodeData<Bytes>),
Projection(Cid, Ipld),
Link(Cid, Cid),
}
Expand description
IpfsPath
’s Cid
-based variant can be resolved to the block, projections represented by this
type.
Values can be converted to Ipld using Ipld::try_from
.
Variants§
Block(Block)
Block which was loaded at the end of the path.
DagPbData(Cid, NodeData<Bytes>)
Path ended in Data
at a dag-pb node. This is usually not interesting and should be
treated as a “Not found” error since dag-pb node did not have a link called Data
. The variant
exists as there are interface-ipfs-http tests which require this behaviour.
Projection(Cid, Ipld)
Path ended on a !dag-pb document which was projected.
Link(Cid, Cid)
Local resolving ended with a link
Implementations§
Source§impl ResolvedNode
impl ResolvedNode
Sourcepub fn source(&self) -> &Cid
pub fn source(&self) -> &Cid
Returns the Cid
of the source document for the encapsulated document or projection of such.
Sourcepub fn into_unixfs_block(self) -> Result<Block, UnexpectedResolved>
pub fn into_unixfs_block(self) -> Result<Block, UnexpectedResolved>
Unwraps the dagpb block variant and turns others into UnexpectedResolved. This is useful wherever unixfs operations are continued after resolving an IpfsPath.
Trait Implementations§
Source§impl Debug for ResolvedNode
impl Debug for ResolvedNode
Source§impl PartialEq for ResolvedNode
impl PartialEq for ResolvedNode
Source§impl TryFrom<ResolvedNode> for Ipld
impl TryFrom<ResolvedNode> for Ipld
impl StructuralPartialEq for ResolvedNode
Auto Trait Implementations§
impl !Freeze for ResolvedNode
impl RefUnwindSafe for ResolvedNode
impl Send for ResolvedNode
impl Sync for ResolvedNode
impl Unpin for ResolvedNode
impl UnwindSafe for ResolvedNode
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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> 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 more