[−][src]Enum forest_ipld::Ipld
Represents IPLD data structure used when serializing and deserializing data.
Variants
Represents a null value.
let v = ipld!(null);
Bool(bool)
Represents a boolean value.
let v = ipld!(true);
Integer(i128)
Represents a signed integer value.
let v = ipld!(28);
Float(f64)
Represents a floating point value.
let v = ipld!(8.5);
String(String)
Represents a String.
let v = ipld!("string");
Represents Bytes.
let v = ipld!(Bytes(vec![0x98, 0x8, 0x2a, 0xff]));
Represents List of IPLD objects.
let v = ipld!([1, "string", null]);
Represents a map of strings to Ipld objects.
let v = ipld!({"key": "value", "bool": true});
Link(Cid)
Represents a link to another piece of data through a content identifier (Cid
).
Using ipld
macro, can wrap Cid with Link to be explicit of Link type, or let it resolve.
let cid: Cid = "QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n".parse().unwrap(); let v1 = ipld!(Link(cid.clone())); let v2 = ipld!(cid); assert_eq!(v1, v2);
Trait Implementations
impl Cbor for Ipld
[src]
pub fn marshal_cbor(&self) -> Result<Vec<u8, Global>, Error>
[src]
pub fn unmarshal_cbor(bz: &[u8]) -> Result<Self, Error>
[src]
pub fn cid(&self) -> Result<Cid, Error>
[src]
impl Clone for Ipld
[src]
impl Debug for Ipld
[src]
impl<'de> Deserialize<'de> for Ipld
[src]
pub fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl PartialEq<Ipld> for Ipld
[src]
impl Serialize for Ipld
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,