Struct songbird::input::restartable::Restartable[][src]

pub struct Restartable { /* fields omitted */ }

A wrapper around a method to create a new Input which seeks backward by recreating the source.

The main purpose of this wrapper is to enable seeking on incompatible sources (i.e., ffmpeg output) and to ease resource consumption for commonly reused/shared tracks. Compressed and Memory offer the same functionality with different tradeoffs.

This is intended for use with single-use audio tracks which may require looping or seeking, but where additional memory cannot be spared. Forward seeks will drain the track until reaching the desired timestamp.

Implementations

impl Restartable[src]

pub async fn new(
    recreator: impl Restart + Send + 'static,
    lazy: bool
) -> Result<Self>
[src]

Create a new source, which can be restarted using a recreator function.

Lazy sources will not run their input recreator until the first byte is needed, or are sent Track::make_playable/TrackHandle::make_playable.

pub async fn ffmpeg<P: AsRef<OsStr> + Send + Clone + Sync + 'static>(
    path: P,
    lazy: bool
) -> Result<Self>
[src]

Create a new restartable ffmpeg source for a local file.

pub async fn ytdl<P: AsRef<str> + Send + Clone + Sync + 'static>(
    uri: P,
    lazy: bool
) -> Result<Self>
[src]

Create a new restartable ytdl source.

The cost of restarting and seeking will probably be very high: expect a pause if you seek backwards.

Create a new restartable ytdl source, using the first result of a youtube search.

The cost of restarting and seeking will probably be very high: expect a pause if you seek backwards.

Trait Implementations

impl Debug for Restartable[src]

impl From<Restartable> for Input[src]

impl Read for Restartable[src]

impl Seek for Restartable[src]

Auto Trait Implementations

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> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<R> ReadBytesExt for R where
    R: Read + ?Sized
[src]

impl<R> ReadSeek for R where
    R: Read + Seek
[src]

impl<R> ReadSkipExt for R where
    R: Read
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]