pub trait SyncChunkGetExt<const BODY_SIZE: usize>: SyncChunkGet<BODY_SIZE> {
// Provided methods
fn joiner<R: JoinRef>(
self,
root: R,
) -> Result<GenericSyncJoiner<Self, R::Mode, BODY_SIZE>>
where Self: Clone + Send + Sync + Sized { ... }
fn read_file<R: JoinRef>(self, root: R) -> Result<Vec<u8>>
where Self: Clone + Send + Sync + Sized { ... }
}Expand description
Extension methods for sync chunk getters.
Automatically implemented for all types that implement SyncChunkGet.
Uses JoinRef for unified plain/encrypted dispatch.
use nectar_primitives::file::{SyncChunkPutExt, SyncChunkGetExt};
use nectar_primitives::store::MemoryStore;
use nectar_primitives::DEFAULT_BODY_SIZE;
let store = MemoryStore::<DEFAULT_BODY_SIZE>::new();
let addr = store.write_file(b"hello swarm").unwrap();
let recovered = store.read_file(addr).unwrap();
assert_eq!(recovered, b"hello swarm");Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".