Struct noosphere_core::data::BodyChunkIpld
source · Expand description
A body chunk is a simplified flexible byte layout used for linking chunks of bytes. This is necessary to support cases when body contents byte size exceeds the IPFS block size (~1MB). This may be replaced with a more sophisticated layout structure in the future.
Fields§
§bytes: Vec<u8>A chunk of bytes
next: Option<Cid>An optional pointer to the next chunk of bytes, if there are any remaining
Implementations§
source§impl BodyChunkIpld
impl BodyChunkIpld
pub async fn store_bytes<S: BlockStore>(
bytes: &[u8],
store: &mut S
) -> Result<Cid>
pub async fn load_all_bytes<S: BlockStore>(&self, store: &S) -> Result<Vec<u8>>
Trait Implementations§
source§impl Clone for BodyChunkIpld
impl Clone for BodyChunkIpld
source§fn clone(&self) -> BodyChunkIpld
fn clone(&self) -> BodyChunkIpld
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for BodyChunkIpld
impl Debug for BodyChunkIpld
source§impl<'de> Deserialize<'de> for BodyChunkIpld
impl<'de> Deserialize<'de> for BodyChunkIpld
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more