Skip to main content

Vault

Trait Vault 

Source
pub trait Vault:
    Send
    + Sync
    + 'static {
    // Required methods
    fn ceiling(&self) -> usize;
    fn cadence(&self) -> Duration;
    fn open(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<u64, EvidenceError>> + Send;
    fn external(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<Option<PathBuf>, EvidenceError>> + Send;
    fn append(
        &self,
        name: &str,
        bytes: &[u8],
    ) -> impl Future<Output = Result<u64, EvidenceError>> + Send;
    fn length(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<u64, EvidenceError>> + Send;
    fn verify(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<(u64, u64), EvidenceError>> + Send;
    fn claim(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<(), EvidenceError>> + Send;
    fn quarantine(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<(), EvidenceError>> + Send;
    fn read(
        &self,
        name: &str,
        offset: u64,
        limit: usize,
    ) -> impl Future<Output = Result<(Vec<u8>, u64), EvidenceError>> + Send;
    fn read_draft(
        &self,
        name: &str,
        offset: u64,
        limit: usize,
    ) -> impl Future<Output = Result<(Vec<u8>, u64), EvidenceError>> + Send;
}

Required Methods§

Source

fn ceiling(&self) -> usize

Source

fn cadence(&self) -> Duration

Source

fn open( &self, name: &str, ) -> impl Future<Output = Result<u64, EvidenceError>> + Send

Source

fn external( &self, name: &str, ) -> impl Future<Output = Result<Option<PathBuf>, EvidenceError>> + Send

Source

fn append( &self, name: &str, bytes: &[u8], ) -> impl Future<Output = Result<u64, EvidenceError>> + Send

Source

fn length( &self, name: &str, ) -> impl Future<Output = Result<u64, EvidenceError>> + Send

Source

fn verify( &self, name: &str, ) -> impl Future<Output = Result<(u64, u64), EvidenceError>> + Send

Source

fn claim( &self, name: &str, ) -> impl Future<Output = Result<(), EvidenceError>> + Send

Source

fn quarantine( &self, name: &str, ) -> impl Future<Output = Result<(), EvidenceError>> + Send

Source

fn read( &self, name: &str, offset: u64, limit: usize, ) -> impl Future<Output = Result<(Vec<u8>, u64), EvidenceError>> + Send

Source

fn read_draft( &self, name: &str, offset: u64, limit: usize, ) -> impl Future<Output = Result<(Vec<u8>, u64), EvidenceError>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§