Skip to main content

Session

Struct Session 

Source
pub struct Session<'a, T: Transport> { /* private fields */ }
Expand description

An open flash session, returned by enter_update.

The drive programs flash when the last chunk of a complete image lands, before finish. Dropping the session sends nothing and does not roll back earlier writes.

Implementations§

Source§

impl<T: Transport> Session<'_, T>

Source

pub fn write(&mut self, off: u32, data: &[u8]) -> Result<(), Error<T::Error>>

Write data at file offset off. off must fit in 24 bits and data.len() in 16; the OEM sequence uses cdb::CHUNK.

Source

pub fn finish(self) -> Result<(), Error<T::Error>>

Send the commit handshake. The drive may answer with a transient CHECK CONDITION while it reinitializes; callers verify the outcome with test_unit_ready, request_sense and a read-back.

Trait Implementations§

Source§

impl<T: Transport> Debug for Session<'_, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T> !UnwindSafe for Session<'a, T>

§

impl<'a, T> Freeze for Session<'a, T>

§

impl<'a, T> RefUnwindSafe for Session<'a, T>

§

impl<'a, T> Send for Session<'a, T>
where &'a mut T: Send,

§

impl<'a, T> Sync for Session<'a, T>
where &'a mut T: Sync,

§

impl<'a, T> Unpin for Session<'a, T>

§

impl<'a, T> UnsafeUnpin for Session<'a, T>

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.