[][src]Struct dvdcss::DVD

#[repr(transparent)]pub struct DVD { /* fields omitted */ }

An instance of dvdcss. Represents a DVD which has been loaded into a drive.

Must have its destructor run.

Implementations

impl DVD[src]

pub fn new(location: &CStr) -> Option<Self>[src]

Opens the DVD at the device location specified in the string (eg /dev/sr0).

Returns None if there is no DVD in the drive.

pub fn seek(&self, blocks: u32, flags: SeekOptions) -> Result<u32, ()>[src]

Sets the absolute position of the needle of the DVD.

The value blocks determines in intervals of 2048 (the size of a block) the absolute location to which the needle should be moved.

The flags behavior is documented in SeekOptions.

Returns Ok and the new position in blocks if the operation succeeded, and Err if it did not.

pub fn read(&self, buffer: &mut [Block], decrypt: bool) -> Result<u32, ()>[src]

Fills each Block of buffer with the raw contents of the DVD from the current position of the needle, which is modifiable with the seek function.

The decrypt boolean should be enabled when the DVD is encrypted.

Returns Ok and the accompanying number of blocks read if the operation succeeded, and Err if it did not.

pub fn is_scrambled(&self) -> bool[src]

Returns whether the DVD being read is scrambled.

pub fn latest_error(&self) -> &CStr[src]

Returns text describing the latest error encountered by dvdcss.

Output is undefined if no error was encountered, but should not crash to read.

Trait Implementations

impl Drop for DVD[src]

Auto Trait Implementations

impl RefUnwindSafe for DVD[src]

impl !Send for DVD[src]

impl !Sync for DVD[src]

impl Unpin for DVD[src]

impl UnwindSafe for DVD[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.