Enum libipld_core::ipld::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.
Link(Cid)
Represents a map of integers.
Implementations
sourceimpl Ipld
impl Ipld
sourcepub fn take<'a, T: Into<IpldIndex<'a>>>(
self,
index: T
) -> Result<Self, TypeError>
pub fn take<'a, T: Into<IpldIndex<'a>>>(
self,
index: T
) -> Result<Self, TypeError>
Destructs an ipld list or map
sourcepub fn get<'a, T: Into<IpldIndex<'a>>>(
&self,
index: T
) -> Result<&Self, TypeError>
pub fn get<'a, T: Into<IpldIndex<'a>>>(
&self,
index: T
) -> Result<&Self, TypeError>
Indexes into an ipld list or map.
sourcepub fn iter(&self) -> IpldIter<'_>ⓘNotable traits for IpldIter<'a>impl<'a> Iterator for IpldIter<'a> type Item = &'a Ipld;
pub fn iter(&self) -> IpldIter<'_>ⓘNotable traits for IpldIter<'a>impl<'a> Iterator for IpldIter<'a> type Item = &'a Ipld;
Returns an iterator.
sourcepub fn references<E: Extend<Cid>>(&self, set: &mut E)
pub fn references<E: Extend<Cid>>(&self, set: &mut E)
Returns the references to other blocks.
Trait Implementations
sourceimpl From<&Ipld> for TypeErrorType
impl From<&Ipld> for TypeErrorType
sourceimpl From<Ipld> for TypeErrorType
impl From<Ipld> for TypeErrorType
sourceimpl PartialEq<Ipld> for Ipld
impl PartialEq<Ipld> 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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