Skip to main content

DirectFileDestination

Trait DirectFileDestination 

Source
pub trait DirectFileDestination: Send + Sync {
    // Required methods
    fn prepare(
        &self,
        transfer_id: String,
        files: Vec<DirectFileSnapshot>,
    ) -> Result<(), DirectFileDestinationError>;
    fn write(
        &self,
        file_index: u32,
        bytes: Vec<u8>,
    ) -> Result<(), DirectFileDestinationError>;
    fn finish_file(
        &self,
        file_index: u32,
    ) -> Result<(), DirectFileDestinationError>;
    fn commit(&self) -> Result<Vec<String>, DirectFileDestinationError>;
    fn abort(&self);
}
Expand description

Each selected destination belongs to one acceptance. abort must remove only newly created partial outputs; it must never delete or truncate existing files. prepare must clean its own partial preparation on error, without disturbing an already-open destination if the same object is accidentally reused.

Required Methods§

Trait Implementations§

Source§

impl Debug for dyn DirectFileDestination

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> FfiConverterArc<T> for dyn DirectFileDestination

Source§

const TYPE_ID_META: MetadataBuffer

Source§

type FfiType = *const c_void

Source§

fn lower(obj: Arc<Self>) -> Self::FfiType

Source§

fn try_lift(v: Self::FfiType) -> Result<Arc<Self>>

Source§

fn write(obj: Arc<Self>, buf: &mut Vec<u8>)

Source§

fn try_read(buf: &mut &[u8]) -> Result<Arc<Self>>

Source§

impl<T> LiftRef<T> for dyn DirectFileDestination

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§