[][src]Enum ipfs::dag::ResolvedNode

pub enum ResolvedNode {
    Block(Block),
    DagPbData(CidNodeData<Box<[u8]>>),
    Projection(CidIpld),
    Link(CidCid),
}

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(CidNodeData<Box<[u8]>>)

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(CidIpld)

Path ended on a !dag-pb document which was projected.

Local resolving ended with a link

Implementations

impl ResolvedNode[src]

pub fn source(&self) -> &Cid[src]

Returns the Cid of the source document for the encapsulated document or projection of such.

pub fn into_unixfs_block(self) -> Result<Block, UnexpectedResolved>[src]

Unwraps the dagpb block variant and turns others into UnexpectedResolved. This is useful wherever unixfs operations are continued after resolving an IpfsPath.

Trait Implementations

impl Debug for ResolvedNode[src]

impl PartialEq<ResolvedNode> for ResolvedNode[src]

impl StructuralPartialEq for ResolvedNode[src]

impl TryFrom<ResolvedNode> for Ipld[src]

type Error = ResolveError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]