Enum libipld::codec_impl::IpldCodec
source · pub enum IpldCodec {
Raw,
DagCbor,
DagJson,
DagPb,
}
Expand description
Default codecs.
Variants
Trait Implementations
sourceimpl Codec for IpldCodec
impl Codec for IpldCodec
sourcefn encode<T>(&self, obj: &T) -> Result<Vec<u8, Global>, Error>where
T: Encode<Self> + ?Sized,
fn encode<T>(&self, obj: &T) -> Result<Vec<u8, Global>, Error>where
T: Encode<Self> + ?Sized,
Encodes an encodable type.
sourcefn decode<T>(&self, bytes: &[u8]) -> Result<T, Error>where
T: Decode<Self>,
fn decode<T>(&self, bytes: &[u8]) -> Result<T, Error>where
T: Decode<Self>,
Decodes a decodable type.
sourcefn references<T, E>(&self, bytes: &[u8], set: &mut E) -> Result<(), Error>where
T: References<Self>,
E: Extend<Cid<64>>,
fn references<T, E>(&self, bytes: &[u8], set: &mut E) -> Result<(), Error>where
T: References<Self>,
E: Extend<Cid<64>>,
Scrapes the references.
sourceimpl From<DagCborCodec> for IpldCodec
impl From<DagCborCodec> for IpldCodec
sourcefn from(_: DagCborCodec) -> Self
fn from(_: DagCborCodec) -> Self
Converts to this type from the input type.
sourceimpl From<DagJsonCodec> for IpldCodec
impl From<DagJsonCodec> for IpldCodec
sourcefn from(_: DagJsonCodec) -> Self
fn from(_: DagJsonCodec) -> Self
Converts to this type from the input type.
sourceimpl From<DagPbCodec> for IpldCodec
impl From<DagPbCodec> for IpldCodec
sourcefn from(_: DagPbCodec) -> Self
fn from(_: DagPbCodec) -> Self
Converts to this type from the input type.
sourceimpl From<IpldCodec> for DagCborCodec
impl From<IpldCodec> for DagCborCodec
sourceimpl From<IpldCodec> for DagJsonCodec
impl From<IpldCodec> for DagJsonCodec
sourceimpl From<IpldCodec> for DagPbCodec
impl From<IpldCodec> for DagPbCodec
sourceimpl References<IpldCodec> for Ipld
impl References<IpldCodec> for Ipld
impl Copy for IpldCodec
impl Eq for IpldCodec
impl StructuralEq for IpldCodec
impl StructuralPartialEq for IpldCodec
Auto Trait Implementations
impl RefUnwindSafe for IpldCodec
impl Send for IpldCodec
impl Sync for IpldCodec
impl Unpin for IpldCodec
impl UnwindSafe for IpldCodec
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