Skip to main content

TrackBounds

Enum TrackBounds 

Source
pub enum TrackBounds {
    SessionGap,
    Gapless,
}
Expand description

Policy for deriving a track’s half-open sector range from a Toc.

A track begins at its own Track::start_lba. Normally it ends at the next track’s start_lba, or at Toc::leadout_lba when it is the final track.

§CD-Extra session gaps

A CD-Extra disc places a standard 11,400-sector inter-session gap between its final audio track and the following data session. This is 152 seconds, or 2 minutes 32 seconds. In a geometry-preserving address space, the first data track’s start_lba lies after that gap, so treating it as the audio track’s end would incorrectly include the gap in the audio range.

Some image formats and extracts remove the inter-session gap and store the tracks back-to-back. In that layout, the next track’s start_lba is already the correct end of the audio track; subtracting 11,400 sectors would instead truncate 152 seconds of audio.

This policy affects only the last audio track followed exclusively by data tracks. All other tracks have identical bounds under both variants.

Choose the variant according to the address space represented jointly by the backing and its Toc:

  • SessionGap for a physical disc or an image that preserves the disc’s original sector geometry.
  • Gapless for a contiguous, gap-stripped image or extract.

Gapless refers only to the CD-Extra inter-session gap. It does not remove ordinary track pregaps or provide gapless playback.

read_track and open_track_stream use SessionGap by default. Use read_track_with_bounds or open_track_stream_with_bounds when the source requires an explicit policy.

Variants§

§

SessionGap

The address space includes the CD-Extra inter-session gap.

When applicable, the final audio track ends 11,400 sectors before the following data track.

§

Gapless

The address space stores tracks contiguously without the CD-Extra inter-session gap.

Every track ends at the next track’s start, or at the lead-out.

Trait Implementations§

Source§

impl Clone for TrackBounds

Source§

fn clone(&self) -> TrackBounds

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TrackBounds

Source§

impl Debug for TrackBounds

Source§

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

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

impl Eq for TrackBounds

Source§

impl PartialEq for TrackBounds

Source§

fn eq(&self, other: &TrackBounds) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TrackBounds

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.