Skip to main content

Toc

Struct Toc 

Source
pub struct Toc {
    pub first_track: u8,
    pub last_track: u8,
    pub tracks: Vec<Track>,
    pub leadout_lba: u32,
}
Expand description

Table of Contents, read directly from the Audio CD. The most important part is the tracks vector, which allows you to read raw track data.

If you read from file/image directly, you need to construct it manually.

Fields§

§first_track: u8

First track number reported in the TOC header.

This is a disc track number, not a zero-based index into Toc::tracks. It does not have to start with 1 and can be up to 99.

§last_track: u8

Helper value with the last track number. You should not use it directly to iterate over all available tracks, as there might be gaps.

§tracks: Vec<Track>

List of tracks with LBA and MSF offsets

§leadout_lba: u32

LBA at which the lead-out area begins, as reported by the disc TOC.

Track-bound calculations use this as the upper bound only for the last entry in Toc::tracks. If another track follows, its start and any applicable CD-Extra session-gap handling determine the preceding track’s bound instead. The lead-out LBA is also required to calculate a MusicBrainz Disc ID.

Trait Implementations§

Source§

impl Debug for Toc

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Toc

§

impl RefUnwindSafe for Toc

§

impl Send for Toc

§

impl Sync for Toc

§

impl Unpin for Toc

§

impl UnsafeUnpin for Toc

§

impl UnwindSafe for Toc

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 = !

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.