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
sourceimpl 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
sourceimpl Clone for BodyChunkIpld
impl Clone for BodyChunkIpld
sourcefn clone(&self) -> BodyChunkIpld
fn clone(&self) -> BodyChunkIpld
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for BodyChunkIpld
impl Debug for BodyChunkIpld
sourceimpl<'de> Deserialize<'de> for BodyChunkIpld
impl<'de> Deserialize<'de> for BodyChunkIpld
sourcefn 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
sourceimpl PartialEq<BodyChunkIpld> for BodyChunkIpld
impl PartialEq<BodyChunkIpld> for BodyChunkIpld
sourcefn eq(&self, other: &BodyChunkIpld) -> bool
fn eq(&self, other: &BodyChunkIpld) -> bool
sourceimpl Serialize for BodyChunkIpld
impl Serialize for BodyChunkIpld
sourceimpl TryBundle for BodyChunkIpld
impl TryBundle for BodyChunkIpld
fn try_extend_bundle_with_cid<'life0, 'life1, 'life2, 'async_trait, S>(
cid: &'life0 Cid,
bundle: &'life1 mut Bundle,
store: &'life2 S
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
S: 'async_trait + BlockStore,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn try_extend_bundle<'life0, 'life1, 'life2, 'async_trait, S>(
&'life0 self,
bundle: &'life1 mut Bundle,
_store: &'life2 S
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
S: 'async_trait + BlockStore,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
fn try_bundle<'life0, 'life1, 'async_trait, S>(
&'life0 self,
store: &'life1 S
) -> Pin<Box<dyn Future<Output = Result<Bundle>> + Send + 'async_trait>>where
S: 'async_trait + BlockStore,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn try_bundle_with_cid<'life0, 'life1, 'async_trait, S>(
cid: &'life0 Cid,
store: &'life1 S
) -> Pin<Box<dyn Future<Output = Result<Bundle>> + Send + 'async_trait>>where
S: 'async_trait + BlockStore,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
impl Eq for BodyChunkIpld
impl StructuralEq for BodyChunkIpld
impl StructuralPartialEq for BodyChunkIpld
Auto Trait Implementations
impl RefUnwindSafe for BodyChunkIpld
impl Send for BodyChunkIpld
impl Sync for BodyChunkIpld
impl Unpin for BodyChunkIpld
impl UnwindSafe for BodyChunkIpld
Blanket Implementations
sourceimpl<T> Base64Encode for Twhere
T: DagJson,
impl<T> Base64Encode for Twhere
T: DagJson,
fn jwt_base64_encode(&self) -> Result<String, Error>
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