Struct PAT

Source
pub struct PAT {}
Expand description

PAT Audio Technician (PAT)

Implementations§

Source§

impl PAT

Source

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

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

§Examples
rustpat::PAT::new().unwrap();
Source

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

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();
Source

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

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();
Source

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

Pause audio playback.

This method does nothing if audio playback is already paused.

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

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

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 Freeze for PAT

§

impl RefUnwindSafe for PAT

§

impl Send for PAT

§

impl Sync for PAT

§

impl Unpin for PAT

§

impl UnwindSafe for PAT

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

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.