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>
impl<T: Transport> Session<'_, T>
Sourcepub fn write(&mut self, off: u32, data: &[u8]) -> Result<(), Error<T::Error>>
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.
Sourcepub fn finish(self) -> Result<(), Error<T::Error>>
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§
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>where
&'a mut T: RefUnwindSafe,
impl<'a, T> Send for Session<'a, T>
impl<'a, T> Sync for Session<'a, T>
impl<'a, T> Unpin for Session<'a, T>
impl<'a, T> UnsafeUnpin for Session<'a, T>where
&'a mut T: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more