Struct rustpat::PAT[][src]

pub struct PAT {}
Expand description

PAT Audio Technician (PAT)

Implementations

impl PAT[src]

pub fn new() -> Result<PAT, PATError>[src]

Creates a new PAT instance and initializes PAT if it has already been initialized.

Examples

rustpat::PAT::new().unwrap();

pub fn play(&self, pat_audio_path: &str) -> Result<(), PATError>[src]

Play an audio file.

The audio file can be a local file or remote file (http:// or https://).

Examples

let pat = rustpat::PAT::new().unwrap();
let test_audio = format!("{}/src/libpat/test/test.ogg", env!("CARGO_MANIFEST_DIR"));
pat.play(&test_audio).unwrap();

pub fn skip(&self) -> Result<(), PATError>[src]

Skip playback of the current audio file.

This method does nothing if there is not an audio file playing.

Examples

let pat = rustpat::PAT::new().unwrap();
pat.skip().unwrap();

pub fn pause(&self) -> Result<(), PATError>[src]

Pause audio playback.

This method does nothing if audio playback is already paused.

Examples

let pat = rustpat::PAT::new().unwrap();
pat.pause().unwrap();

pub fn resume(&self) -> Result<(), PATError>[src]

Resume audio playback.

This method does nothing if audio playback is already resumed.

Examples

let pat = rustpat::PAT::new().unwrap();
pat.resume().unwrap();

Auto Trait Implementations

impl RefUnwindSafe for PAT

impl Send for PAT

impl Sync for PAT

impl Unpin for PAT

impl UnwindSafe for PAT

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.