pub trait BackendTransfer {
// Required methods
fn status(&self) -> TransferStatus;
fn actual_length(&self) -> usize;
fn buffer(&self) -> &TransferBuffer;
fn set_callback<C: 'static + Fn(BackendTransferType) + Send + Sync>(
&mut self,
cb: C,
);
}Expand description
The backend transfer trait implemention is the interface of a generic transfer structure that each backend type should implement to be compatible with the generic backend device provider logic.
Required Methods§
Sourcefn status(&self) -> TransferStatus
fn status(&self) -> TransferStatus
Returns the status of the transfer in a TransferStatus enum
Sourcefn actual_length(&self) -> usize
fn actual_length(&self) -> usize
Returns the actual amount of data transferred, which may be less than the original length.
Sourcefn buffer(&self) -> &TransferBuffer
fn buffer(&self) -> &TransferBuffer
Returns a reference to the TransferBuffer object.
Sourcefn set_callback<C: 'static + Fn(BackendTransferType) + Send + Sync>(
&mut self,
cb: C,
)
fn set_callback<C: 'static + Fn(BackendTransferType) + Send + Sync>( &mut self, cb: C, )
Sets an optional callback on the transfer to be called when the transfer completes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.