pub enum Ipld {
Null,
Bool(bool),
Integer(i128),
Float(f64),
String(String),
Bytes(Vec<u8, Global>),
List(Vec<Ipld, Global>),
Map(BTreeMap<String, Ipld, Global>),
Link(Cid<64>),
}
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.
Map(BTreeMap<String, Ipld, Global>)
Represents a map of strings.
Link(Cid<64>)
Represents a map of integers.
Implementations
sourceimpl Ipld
impl Ipld
sourcepub fn take<'a, T>(self, index: T) -> Result<Ipld, TypeError>where
T: Into<IpldIndex<'a>>,
pub fn take<'a, T>(self, index: T) -> Result<Ipld, TypeError>where
T: Into<IpldIndex<'a>>,
Destructs an ipld list or map
sourcepub fn get<'a, T>(&self, index: T) -> Result<&Ipld, TypeError>where
T: Into<IpldIndex<'a>>,
pub fn get<'a, T>(&self, index: T) -> Result<&Ipld, TypeError>where
T: Into<IpldIndex<'a>>,
Indexes into an ipld list or map.
sourcepub fn references<E>(&self, set: &mut E)where
E: Extend<Cid<64>>,
pub fn references<E>(&self, set: &mut E)where
E: Extend<Cid<64>>,
Returns the references to other blocks.
Trait Implementations
sourceimpl Decode<DagCborCodec> for Ipld
impl Decode<DagCborCodec> for Ipld
sourceimpl Decode<DagJsonCodec> for Ipld
impl Decode<DagJsonCodec> for Ipld
sourceimpl Decode<DagPbCodec> for Ipld
impl Decode<DagPbCodec> for Ipld
sourceimpl Encode<DagCborCodec> for Ipld
impl Encode<DagCborCodec> for Ipld
sourceimpl Encode<DagJsonCodec> for Ipld
impl Encode<DagJsonCodec> for Ipld
sourceimpl Encode<DagPbCodec> for Ipld
impl Encode<DagPbCodec> for Ipld
sourceimpl From<&Ipld> for TypeErrorType
impl From<&Ipld> for TypeErrorType
sourcefn from(ipld: &Ipld) -> TypeErrorType
fn from(ipld: &Ipld) -> TypeErrorType
Converts to this type from the input type.
sourceimpl From<Ipld> for TypeErrorType
impl From<Ipld> for TypeErrorType
sourcefn from(ipld: Ipld) -> TypeErrorType
fn from(ipld: Ipld) -> TypeErrorType
Converts to this type from the input type.
sourceimpl References<DagCborCodec> for Ipld
impl References<DagCborCodec> for Ipld
sourceimpl References<DagJsonCodec> for Ipld
impl References<DagJsonCodec> for Ipld
sourceimpl References<DagPbCodec> for Ipld
impl References<DagPbCodec> for Ipld
sourceimpl References<IpldCodec> for Ipld
impl References<IpldCodec> for Ipld
impl StructuralPartialEq for Ipld
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more