Enum libipld::ipld::Ipld[][src]

pub enum Ipld {
    Null,
    Bool(bool),
    Integer(i128),
    Float(f64),
    String(String),
    Bytes(Vec<u8, Global>),
    List(Vec<Ipld, Global>),
    StringMap(BTreeMap<String, Ipld>),
    Link(Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>),
}
Expand description

Ipld

Variants

Null

Represents the absence of a value or the value undefined.

Bool(bool)

Represents a boolean value.

Integer(i128)

Represents an integer.

Float(f64)

Represents a floating point value.

String(String)

Represents an UTF-8 string.

Bytes(Vec<u8, Global>)

Represents a sequence of bytes.

List(Vec<Ipld, Global>)

Represents a list.

StringMap(BTreeMap<String, Ipld>)

Represents a map of strings.

Represents a link to an Ipld node.

Implementations

impl Ipld[src]

pub fn take<'a, T>(self, index: T) -> Result<Ipld, TypeError> where
    T: Into<IpldIndex<'a>>, 
[src]

Destructs an ipld list or map

pub fn get<'a, T>(&self, index: T) -> Result<&Ipld, TypeError> where
    T: Into<IpldIndex<'a>>, 
[src]

Indexes into an ipld list or map.

pub fn iter(&self) -> IpldIter<'_>

Notable traits for IpldIter<'a>

impl<'a> Iterator for IpldIter<'a> type Item = &'a Ipld;
[src]

Returns an iterator.

pub fn references<E>(&self, set: &mut E) where
    E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>, 
[src]

Returns the references to other blocks.

Trait Implementations

impl Clone for Ipld[src]

pub fn clone(&self) -> Ipld[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Ipld[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Decode<DagCborCodec> for Ipld[src]

pub fn decode<R>(DagCborCodec, r: &mut R) -> Result<Ipld, Error> where
    R: Read + Seek
[src]

Decode from an impl Read. Read more

impl Decode<DagJsonCodec> for Ipld[src]

pub fn decode<R>(DagJsonCodec, r: &mut R) -> Result<Ipld, Error> where
    R: Read + Seek
[src]

Decode from an impl Read. Read more

impl Decode<DagPbCodec> for Ipld[src]

pub fn decode<R>(DagPbCodec, r: &mut R) -> Result<Ipld, Error> where
    R: Read + Seek
[src]

Decode from an impl Read. Read more

impl Decode<IpldCodec> for Ipld[src]

fn decode<R: Read + Seek>(c: IpldCodec, r: &mut R) -> Result<Self>[src]

Decode from an impl Read. Read more

impl Decode<RawCodec> for Ipld[src]

pub fn decode<R>(c: RawCodec, r: &mut R) -> Result<Ipld, Error> where
    R: Read + Seek
[src]

Decode from an impl Read. Read more

impl Encode<DagCborCodec> for Ipld[src]

pub fn encode<W>(&self, c: DagCborCodec, w: &mut W) -> Result<(), Error> where
    W: Write
[src]

Encodes into a impl Write. Read more

impl Encode<DagJsonCodec> for Ipld[src]

pub fn encode<W>(&self, DagJsonCodec, w: &mut W) -> Result<(), Error> where
    W: Write
[src]

Encodes into a impl Write. Read more

impl Encode<DagPbCodec> for Ipld[src]

pub fn encode<W>(&self, DagPbCodec, w: &mut W) -> Result<(), Error> where
    W: Write
[src]

Encodes into a impl Write. Read more

impl Encode<IpldCodec> for Ipld[src]

fn encode<W: Write>(&self, c: IpldCodec, w: &mut W) -> Result<()>[src]

Encodes into a impl Write. Read more

impl Encode<RawCodec> for Ipld[src]

pub fn encode<W>(&self, c: RawCodec, w: &mut W) -> Result<(), Error> where
    W: Write
[src]

Encodes into a impl Write. Read more

impl<'_> From<&'_ [u8]> for Ipld[src]

pub fn from(t: &[u8]) -> Ipld[src]

Performs the conversion.

impl<'_> From<&'_ Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>> for Ipld[src]

pub fn from(
    t: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
) -> Ipld
[src]

Performs the conversion.

impl<'_> From<&'_ Ipld> for TypeErrorType[src]

pub fn from(ipld: &Ipld) -> TypeErrorType[src]

Performs the conversion.

impl<'_> From<&'_ str> for Ipld[src]

pub fn from(t: &str) -> Ipld[src]

Performs the conversion.

impl From<BTreeMap<String, Ipld>> for Ipld[src]

pub fn from(t: BTreeMap<String, Ipld>) -> Ipld[src]

Performs the conversion.

impl From<Box<[u8], Global>> for Ipld[src]

pub fn from(t: Box<[u8], Global>) -> Ipld[src]

Performs the conversion.

impl From<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>> for Ipld[src]

pub fn from(
    t: Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
) -> Ipld
[src]

Performs the conversion.

impl From<Ipld> for TypeErrorType[src]

pub fn from(ipld: Ipld) -> TypeErrorType[src]

Performs the conversion.

impl From<PbLink> for Ipld[src]

pub fn from(link: PbLink) -> Ipld[src]

Performs the conversion.

impl From<PbNode> for Ipld[src]

pub fn from(node: PbNode) -> Ipld[src]

Performs the conversion.

impl From<String> for Ipld[src]

pub fn from(t: String) -> Ipld[src]

Performs the conversion.

impl From<Vec<Ipld, Global>> for Ipld[src]

pub fn from(t: Vec<Ipld, Global>) -> Ipld[src]

Performs the conversion.

impl From<Vec<u8, Global>> for Ipld[src]

pub fn from(t: Vec<u8, Global>) -> Ipld[src]

Performs the conversion.

impl From<bool> for Ipld[src]

pub fn from(t: bool) -> Ipld[src]

Performs the conversion.

impl From<f32> for Ipld[src]

pub fn from(t: f32) -> Ipld[src]

Performs the conversion.

impl From<f64> for Ipld[src]

pub fn from(t: f64) -> Ipld[src]

Performs the conversion.

impl From<i128> for Ipld[src]

pub fn from(t: i128) -> Ipld[src]

Performs the conversion.

impl From<i16> for Ipld[src]

pub fn from(t: i16) -> Ipld[src]

Performs the conversion.

impl From<i32> for Ipld[src]

pub fn from(t: i32) -> Ipld[src]

Performs the conversion.

impl From<i64> for Ipld[src]

pub fn from(t: i64) -> Ipld[src]

Performs the conversion.

impl From<i8> for Ipld[src]

pub fn from(t: i8) -> Ipld[src]

Performs the conversion.

impl From<isize> for Ipld[src]

pub fn from(t: isize) -> Ipld[src]

Performs the conversion.

impl From<u16> for Ipld[src]

pub fn from(t: u16) -> Ipld[src]

Performs the conversion.

impl From<u32> for Ipld[src]

pub fn from(t: u32) -> Ipld[src]

Performs the conversion.

impl From<u64> for Ipld[src]

pub fn from(t: u64) -> Ipld[src]

Performs the conversion.

impl From<u8> for Ipld[src]

pub fn from(t: u8) -> Ipld[src]

Performs the conversion.

impl From<usize> for Ipld[src]

pub fn from(t: usize) -> Ipld[src]

Performs the conversion.

impl PartialEq<Ipld> for Ipld[src]

pub fn eq(&self, other: &Ipld) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &Ipld) -> bool[src]

This method tests for !=.

impl References<DagCborCodec> for Ipld[src]

pub fn references<R, E>(
    c: DagCborCodec,
    r: &mut R,
    set: &mut E
) -> Result<(), Error> where
    E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
    R: Read + Seek
[src]

Scrape the references from an impl Read. Read more

impl References<DagJsonCodec> for Ipld[src]

pub fn references<R, E>(
    c: DagJsonCodec,
    r: &mut R,
    set: &mut E
) -> Result<(), Error> where
    E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
    R: Read + Seek
[src]

Scrape the references from an impl Read. Read more

impl References<DagPbCodec> for Ipld[src]

pub fn references<R, E>(
    c: DagPbCodec,
    r: &mut R,
    set: &mut E
) -> Result<(), Error> where
    E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
    R: Read + Seek
[src]

Scrape the references from an impl Read. Read more

impl References<IpldCodec> for Ipld[src]

fn references<R: Read + Seek, E: Extend<Cid>>(
    c: IpldCodec,
    r: &mut R,
    set: &mut E
) -> Result<()>
[src]

Scrape the references from an impl Read. Read more

impl StructuralPartialEq for Ipld[src]

Auto Trait Implementations

impl RefUnwindSafe for Ipld

impl Send for Ipld

impl Sync for Ipld

impl Unpin for Ipld

impl UnwindSafe for Ipld

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> References<RawCodec> for T[src]

pub fn references<R, E>(
    _c: RawCodec,
    _r: &mut R,
    _set: &mut E
) -> Result<(), Error> where
    E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
    R: Read
[src]

Scrape the references from an impl Read. Read more

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> DagCbor for T where
    T: Encode<DagCborCodec> + Decode<DagCborCodec>, 
[src]