Ipld

Enum Ipld 

Source
pub enum Ipld {
    Null,
    Bool(bool),
    Integer(i128),
    Float(f64),
    String(String),
    Bytes(Vec<u8>),
    List(Vec<Ipld>),
    Map(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.

§

Map(BTreeMap<String, Ipld>)

Represents a map of strings.

Represents a map of integers.

Implementations§

Source§

impl Ipld

Source

pub fn take<'a, T: Into<IpldIndex<'a>>>( self, index: T, ) -> Result<Self, TypeError>

Destructs an ipld list or map

Source

pub fn get<'a, T: Into<IpldIndex<'a>>>( &self, index: T, ) -> Result<&Self, TypeError>

Indexes into an ipld list or map.

Source

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

Returns an iterator.

Source

pub fn references<E: Extend<Cid>>(&self, set: &mut E)

Returns the references to other blocks.

Trait Implementations§

Source§

impl Clone for Ipld

Source§

fn clone(&self) -> Ipld

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Ipld

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Decode<RawCodec> for Ipld

Source§

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

Decode from an impl Read. Read more
Source§

impl Encode<RawCodec> for Ipld

Source§

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

Encodes into a impl Write. Read more
Source§

impl From<&[u8]> for Ipld

Source§

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

Converts to this type from the input type.
Source§

impl From<&Cid<64>> for Ipld

Source§

fn from(t: &Cid) -> Self

Converts to this type from the input type.
Source§

impl From<&Ipld> for TypeErrorType

Source§

fn from(ipld: &Ipld) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for Ipld

Source§

fn from(t: &str) -> Self

Converts to this type from the input type.
Source§

impl From<BTreeMap<String, Ipld>> for Ipld

Source§

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

Converts to this type from the input type.
Source§

impl From<Box<[u8]>> for Ipld

Source§

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

Converts to this type from the input type.
Source§

impl From<Cid<64>> for Ipld

Source§

fn from(t: Cid) -> Self

Converts to this type from the input type.
Source§

impl From<Ipld> for TypeErrorType

Source§

fn from(ipld: Ipld) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Ipld

Source§

fn from(t: String) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Ipld>> for Ipld

Source§

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

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for Ipld

Source§

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

Converts to this type from the input type.
Source§

impl From<bool> for Ipld

Source§

fn from(t: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for Ipld

Source§

fn from(t: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Ipld

Source§

fn from(t: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for Ipld

Source§

fn from(t: i128) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Ipld

Source§

fn from(t: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Ipld

Source§

fn from(t: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Ipld

Source§

fn from(t: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Ipld

Source§

fn from(t: i8) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for Ipld

Source§

fn from(t: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Ipld

Source§

fn from(t: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Ipld

Source§

fn from(t: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Ipld

Source§

fn from(t: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Ipld

Source§

fn from(t: u8) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for Ipld

Source§

fn from(t: usize) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Ipld

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Ipld

Auto Trait Implementations§

§

impl Freeze for Ipld

§

impl RefUnwindSafe for Ipld

§

impl Send for Ipld

§

impl Sync for Ipld

§

impl Unpin for Ipld

§

impl UnwindSafe for Ipld

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> References<RawCodec> for T

Source§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>
where R: Read, E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.