Skip to main content

FileUpdate

Trait FileUpdate 

Source
pub trait FileUpdate: Send {
    // Required methods
    fn saved_output(&self) -> Option<(&[u8], u64)>;
    fn publish<'life0, 'async_trait>(
        self: Box<Self>,
        work: Arc<WorkBudget>,
        prepared: Option<PreparedFileUpdate>,
        limits: &'life0 TenantLimits,
    ) -> Pin<Box<dyn Future<Output = Result<FileUpdateOutput, FilesystemError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A replacement opened under the backend’s existing serialization boundary. The caller prepares fresh contents or authorizes the saved output before supplying its normal immutable worker budget to publish.

Required Methods§

Source

fn saved_output(&self) -> Option<(&[u8], u64)>

Captured native result and replacement-file byte length, when recovering. Authorize this result without rereading or transforming the public file.

Source

fn publish<'life0, 'async_trait>( self: Box<Self>, work: Arc<WorkBudget>, prepared: Option<PreparedFileUpdate>, limits: &'life0 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<FileUpdateOutput, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Supply freshly prepared contents only when saved_output is absent. Create work after preparation or authorization and settle it after this call, including failures. No refusing fuel charge may follow publication.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§