Enum libipld_core::ipld::Ipld[][src]

pub enum Ipld {
    Null,
    Bool(bool),
    Integer(i128),
    Float(f64),
    String(String),
    Bytes(Vec<u8>),
    List(Vec<Ipld>),
    StringMap(BTreeMap<String, Ipld>),
    Link(Cid),
}
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>)

Represents a sequence of bytes.

List(Vec<Ipld>)

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: Into<IpldIndex<'a>>>(
    self,
    index: T
) -> Result<Self, TypeError>
[src]

Destructs an ipld list or map

pub fn get<'a, T: Into<IpldIndex<'a>>>(
    &self,
    index: T
) -> Result<&Self, TypeError>
[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: Extend<Cid>>(&self, set: &mut E)[src]

Returns the references to other blocks.

Trait Implementations

impl Clone for Ipld[src]

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]

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

Formats the value using the given formatter. Read more

impl Decode<RawCodec> for Ipld[src]

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

Decode from an impl Read. Read more

impl Encode<RawCodec> for Ipld[src]

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

Encodes into a impl Write. Read more

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

fn from(t: &[u8]) -> Self[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]

fn from(t: &Cid) -> Self[src]

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

fn from(t: Box<[u8]>) -> Self[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]

fn from(t: Cid) -> Self[src]

Performs the conversion.

impl From<Ipld> for TypeErrorType[src]

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

Performs the conversion.

impl From<String> for Ipld[src]

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

Performs the conversion.

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

fn from(t: Vec<Ipld>) -> Self[src]

Performs the conversion.

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

fn from(t: Vec<u8>) -> Self[src]

Performs the conversion.

impl From<bool> for Ipld[src]

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

Performs the conversion.

impl From<f32> for Ipld[src]

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

Performs the conversion.

impl From<f64> for Ipld[src]

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

Performs the conversion.

impl From<i128> for Ipld[src]

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

Performs the conversion.

impl From<i16> for Ipld[src]

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

Performs the conversion.

impl From<i32> for Ipld[src]

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

Performs the conversion.

impl From<i64> for Ipld[src]

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

Performs the conversion.

impl From<i8> for Ipld[src]

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

Performs the conversion.

impl From<isize> for Ipld[src]

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

Performs the conversion.

impl From<u16> for Ipld[src]

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

Performs the conversion.

impl From<u32> for Ipld[src]

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

Performs the conversion.

impl From<u64> for Ipld[src]

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

Performs the conversion.

impl From<u8> for Ipld[src]

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

Performs the conversion.

impl From<usize> for Ipld[src]

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

Performs the conversion.

impl PartialEq<Ipld> for Ipld[src]

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

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

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

This method tests for !=.

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>(RawCodec, &mut R, &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.