Skip to main content

IsoCursor

Struct IsoCursor 

Source
pub struct IsoCursor<DATA: Seek> {
    pub data: DATA,
    pub sector_size: usize,
}
Available on crate feature sync only.
Expand description

Represents IsoCursor.

Fields§

§data: DATA

The data field.

§sector_size: usize

The sector_size field.

Implementations§

Source§

impl<DATA: Seek> IsoCursor<DATA>

Source

pub fn new(data: DATA, sector_size: usize) -> Self

Performs the new operation.

Source

pub fn into_inner(self) -> DATA

Consumes the cursor and returns its underlying data source.

Source

pub fn seek_sector(&mut self, sector: LogicalSector) -> Result<u64>

Performs the seek_sector operation.

Source§

impl<DATA: Write + Seek> IsoCursor<DATA>

Source

pub fn pad_align_sector(&mut self) -> Result<LogicalSector>

Advance to the next sector boundary, zero-filling the gap.

The gap is written rather than skipped with a seek: Write + Seek targets are not guaranteed to read unwritten regions back as zeros (reused buffers, block devices with stale data), and readers scan some padding (e.g. the zero record-length terminator at the end of a directory’s sector span). Gaps are always smaller than one sector.

Trait Implementations§

Source§

impl<DATA: Seek> Debug for IsoCursor<DATA>

Source§

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

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

impl<DATA: Read + Seek> Read for IsoCursor<DATA>

Source§

type Error = <DATA as Read>::Error

Error returned by the underlying source.
Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>

Read some bytes, returning zero at end of input.
Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>

Fill buf, retrying interrupted operations.
Source§

impl<DATA: Seek> Seek for IsoCursor<DATA>

Source§

type Error = <DATA as Seek>::Error

Error returned by the underlying stream.
Source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64, Self::Error>

Seek to a new byte position.
Source§

fn stream_position(&mut self) -> Result<u64, Self::Error>

Return the current byte position.
Source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Self::Error>

Seek relative to the current byte position.
Source§

impl<DATA: Write + Seek> Write for IsoCursor<DATA>

Source§

type Error = <DATA as Write>::Error

Error returned by the underlying destination.
Source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>

Write some bytes.
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Flush buffered output.
Source§

fn write_all(&mut self, buf: &[u8]) -> Result<()>

Write all bytes, retrying interrupted operations.

Auto Trait Implementations§

§

impl<DATA> Freeze for IsoCursor<DATA>
where DATA: Freeze,

§

impl<DATA> RefUnwindSafe for IsoCursor<DATA>
where DATA: RefUnwindSafe,

§

impl<DATA> Send for IsoCursor<DATA>
where DATA: Send,

§

impl<DATA> Sync for IsoCursor<DATA>
where DATA: Sync,

§

impl<DATA> Unpin for IsoCursor<DATA>
where DATA: Unpin,

§

impl<DATA> UnsafeUnpin for IsoCursor<DATA>
where DATA: UnsafeUnpin,

§

impl<DATA> UnwindSafe for IsoCursor<DATA>
where DATA: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ReadExt for T
where T: Read + ?Sized,

Source§

fn read_struct<T>(&mut self) -> Result<T, Error>

Read an arbitrary-bit-pattern value.
Source§

fn parse<T>(&mut self) -> Result<T, Error>
where T: Parsable, Self: Sized,

Parse a value with its custom parser.
Source§

impl<T> ReadSeek for T
where T: Read + Seek<Error = <T as Read>::Error> + ?Sized,

Source§

impl<T> ReadWrite for T
where T: Read + Write<Error = <T as Read>::Error> + ?Sized,

Source§

impl<T> ReadWriteSeek for T
where T: Write<Error = <T as Read>::Error> + Seek<Error = <T as Read>::Error> + Read + ?Sized,

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, <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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more