pub trait Api: Send {
const CHUNK_SIZE: usize;
// Required methods
fn start(dry_run: bool) -> Result<usize, Error>;
fn erase() -> Result<(), Error>;
fn write(chunk: &[u8]) -> Result<(), Error>;
fn finish() -> Result<(), Error>;
}
Expand description
Common transfer interface.
A transfer process follows these steps:
start
is called onceerase
is calledstart()
timeswrite
is called zero or more timesfinish
is called once
Required Associated Constants§
Sourceconst CHUNK_SIZE: usize
const CHUNK_SIZE: usize
Complete chunk size in bytes.
Required Methods§
Sourcefn start(dry_run: bool) -> Result<usize, Error>
fn start(dry_run: bool) -> Result<usize, Error>
Starts a transfer process and returns the number of pages to erase.
The destination is not modified if dry-run
is set.
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.