Skip to main content

UploadOptions

Struct UploadOptions 

Source
pub struct UploadOptions {
    pub dest_filename: String,
    pub compression: Compression,
    pub dummy: bool,
    pub chunk_size: usize,
    pub progress: Option<ProgressCallback>,
}
Available on (crate features blocking or tokio or serial) and (crate features blocking or tokio) only.
Expand description

Caller-supplied options controlling the upload.

Not Clone because progress holds a FnMut closure. Debug is implemented manually for the same reason.

Fields§

§dest_filename: String

Destination filename on the device’s SD card. Required.

§compression: Compression

Compression preference. Defaults to Compression::None.

§dummy: bool

Set to true to make the device pretend to receive a file without actually writing it; useful for protocol smoke tests.

§chunk_size: usize

Bytes per WRITE packet. Capped to the device-advertised maximum after the SYNC handshake completes. 0 means “use the device’s max_block_size verbatim”.

§progress: Option<ProgressCallback>

Optional per-chunk progress callback fired once after each acknowledged WRITE. See Progress for the payload.

Trait Implementations§

Source§

impl Debug for UploadOptions

Source§

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

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

impl Default for UploadOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.