Skip to main content

Zone

pub trait Zone {
    // Required methods
    fn size(&self, name: &str) -> Result<u64, String>;
    fn chunk(
        &self,
        name: &str,
        offset: u64,
        len: u64,
    ) -> Result<Vec<u8>, String>;
    fn append(&self, name: &str, bytes: &[u8]) -> Result<(), String>;
    fn delete(&self, name: &str) -> Result<(), String>;

    // Provided method
    fn read_all(&self, name: &str) -> Result<Vec<u8>, String> { ... }
}
Expand description

A zone of the store, as the proof and the import use it.

Required Methods§

Source

fn size(&self, name: &str) -> Result<u64, String>

Source

fn chunk(&self, name: &str, offset: u64, len: u64) -> Result<Vec<u8>, String>

Source

fn append(&self, name: &str, bytes: &[u8]) -> Result<(), String>

Append, creating the file when it is not there.

Source

fn delete(&self, name: &str) -> Result<(), String>

Provided Methods§

Source

fn read_all(&self, name: &str) -> Result<Vec<u8>, String>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Zone for FsZone<'_>