Skip to main content

Engine

Struct Engine 

Source
pub struct Engine { /* private fields */ }

Implementations§

Source§

impl Engine

Source

pub fn status(&self) -> &Status

Source

pub fn config(&self) -> &Config

Source

pub fn store(&self) -> &Store

Source

pub fn subtitles(&self) -> &Snapshot

Source

pub fn playback_failed(&self) -> bool

Source

pub fn change_station( &mut self, command: StationCommand, ) -> Result<StationChange>

Add, edit, remove, or change backup URLs without exposing session state.

Source

pub fn toggle_favorite(&mut self, uuid: &str) -> Result<bool>

Atomically toggle a favorite and return its new state.

Source

pub fn bootstrap(&mut self) -> Result<usize>

Source

pub fn sync(&mut self, progress: impl FnMut(usize)) -> Result<usize>

Fetch and publish a full catalog. This call performs blocking I/O.

Source

pub fn sync_with_policy( &mut self, progress: impl FnMut(usize), accept_shrink: bool, ) -> Result<usize>

Sync with explicit permission to accept a catalog shrink over 25%. This call performs blocking I/O.

Source

pub fn refresh_station(&mut self, uuid: &str) -> Result<Option<Station>>

Fetch current directory metadata without persisting it. Performs I/O.

Source

pub fn report_click(&mut self, uuid: &str) -> Result<()>

Report a confirmed play to the directory. This call performs blocking I/O.

Source

pub fn new(config: Config, stop: Arc<AtomicBool>) -> Result<Self>

Source

pub fn play_episode( &mut self, id: &str, from_start: bool, speed: Option<f64>, ) -> Result<()>

Source

pub fn play_podcast_queue(&mut self, auto_next: bool) -> Result<()>

Source

pub fn seek_episode(&mut self, position: u64) -> Result<()>

Source

pub fn podcast_speed(&mut self, rate: f64) -> Result<()>

Source

pub fn podcast_auto_next(&mut self, on: bool) -> Result<()>

Source

pub fn play(&mut self, uuid: &str) -> Result<()>

Source

pub fn resume_last_station(&mut self) -> Result<()>

Source

pub fn play_recording(&mut self, id: &str) -> Result<()>

Source

pub fn random(&mut self, filter: Filter) -> Result<()>

Source

pub fn podcast_action(&mut self, action: Action) -> Result<()>

Source

pub fn podcast_tasks(&self) -> (usize, bool)

Source

pub fn poll_podcast(&mut self) -> Option<Result<Value>>

Source

pub fn cancel_podcast(&mut self) -> bool

Source

pub fn tick(&mut self) -> Result<()>

Source

pub fn set_subtitles(&mut self, enabled: bool)

Source

pub fn retry_subtitles(&mut self)

Source

pub fn clear_subtitles(&mut self)

Source

pub fn set_subtitle_model(&mut self, id: String) -> Result<()>

Source

pub fn pause(&mut self) -> Result<()>

Source

pub fn mute(&mut self) -> Result<()>

Source

pub fn volume(&mut self, delta: i32) -> Result<()>

Source

pub fn stop_playback(&mut self) -> Result<()>

Source

pub fn toggle_recording(&mut self) -> Result<()>

Source

pub fn record_current( &mut self, duration: Option<Duration>, dir: Option<&Path>, ) -> Result<()>

Source

pub fn standalone_record( &mut self, uuid: &str, duration: Option<Duration>, dir: Option<&Path>, ) -> Result<()>

Source

pub fn stop_recording(&mut self, reason: Option<&str>) -> Result<()>

Source

pub fn delete_recording(&mut self, id: String, index_only: bool) -> Result<()>

Source

pub fn open_recordings(&mut self) -> Result<()>

Source

pub fn playback_active(&self) -> bool

Source

pub fn playback_error(&self) -> Option<&DomainError>

Source

pub fn shutdown(&mut self) -> Result<()>

Trait Implementations§

Source§

impl Drop for Engine

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !Freeze for Engine

§

impl !RefUnwindSafe for Engine

§

impl !Sync for Engine

§

impl !UnwindSafe for Engine

§

impl Forget for Engine

§

impl Move for Engine

§

impl Send for Engine
where Arc<Atomic<bool>>: Send, Receiver<Result<Value, Error>>: Send, Receiver<Result<Option<BrowsePage>, Error>>: Send, Arc<BrowseFileProbe>: Send, RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, Own<ErrorImpl>: Send, Arc<Atomic<u64>>: Send, Arc<Captions>: Send, RawTable<(String, Background<Download>)>: Send, Receiver<Result<(Vec<Download>, Vec<Feed>), Error>>: Send, Arc<Shared>: Send, JoinHandle<()>: Send, Arc<VecDeque<Segment>>: Send, Receiver<Result<bool, Error>>: Send, Receiver<Notice>: Send, Receiver<Result<Option<Vec<Segment>>, Error>>: Send, Arc<Mutex<VerificationCache>>: Send, Weak<VecDeque<Segment>>: Send, Arc<Inner<()>>: Send, Receiver<Result<Option<Metadata>, Error>>: Send, Connection: Send, Arc<InnerClientHandle>: Send, Arc<MediaLock>: Send, Receiver<Result<(Value, bool), Error>>: Send, Receiver<Result<String, Error>>: Send, Receiver<Result<(String, Option<Playlist>), Error>>: Send, Arc<Playlist>: Send, RawTable<(String, Episode)>: Send, RawTable<(String, ())>: Send, Receiver<Result<(Option<Episode>, u64, HashSet<String>), Error>>: Send, Receiver<Result<Option<Station>, Error>>: Send, Receiver<Result<(), Error>>: Send, I32NotAllOnes: Send, Receiver<Result<Player, Error>>: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send, Receiver<Result<Recording, Error>>: Send, Arc<Mutex<String>>: Send,

§

impl Unpin for Engine
where Arc<Atomic<bool>>: Unpin, *mut Counter<Channel<Result<Value, Error>>>: Unpin, *mut Counter<Channel<Result<Value, Error>>>: Unpin, *mut Counter<Channel<Result<Value, Error>>>: Unpin, *mut Counter<Channel<Result<Option<BrowsePage>, Error>>>: Unpin, *mut Counter<Channel<Result<Option<BrowsePage>, Error>>>: Unpin, *mut Counter<Channel<Result<Option<BrowsePage>, Error>>>: Unpin, Arc<BrowseFileProbe>: Unpin, *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, *const ErrorImpl is !null: Unpin, Arc<Atomic<u64>>: Unpin, Arc<Captions>: Unpin, *mut Counter<Channel<Result<Download, Error>>>: Unpin, *mut Counter<Channel<Result<Download, Error>>>: Unpin, *mut Counter<Channel<Result<Download, Error>>>: Unpin, *mut Counter<Channel<Result<(Vec<Download>, Vec<Feed>), Error>>>: Unpin, *mut Counter<Channel<Result<(Vec<Download>, Vec<Feed>), Error>>>: Unpin, *mut Counter<Channel<Result<(Vec<Download>, Vec<Feed>), Error>>>: Unpin, Arc<Shared>: Unpin, Arc<Inner, System>: Unpin, Arc<Packet<'static, ()>>: Unpin, Arc<VecDeque<Segment>>: Unpin, *mut Counter<Channel<Result<bool, Error>>>: Unpin, *mut Counter<Channel<Result<bool, Error>>>: Unpin, *mut Counter<Channel<Result<bool, Error>>>: Unpin, *mut Counter<Channel<Notice>>: Unpin, *mut Counter<Channel<Notice>>: Unpin, *mut Counter<Channel<Notice>>: Unpin, *mut Counter<Channel<Result<Option<Vec<Segment>>, Error>>>: Unpin, *mut Counter<Channel<Result<Option<Vec<Segment>>, Error>>>: Unpin, *mut Counter<Channel<Result<Option<Vec<Segment>>, Error>>>: Unpin, Arc<Mutex<VerificationCache>>: Unpin, *const ArcInner<VecDeque<Segment>> is !null: Unpin, Arc<Inner<()>>: Unpin, *mut Counter<Channel<Result<Option<Metadata>, Error>>>: Unpin, *mut Counter<Channel<Result<Option<Metadata>, Error>>>: Unpin, *mut Counter<Channel<Result<Option<Metadata>, Error>>>: Unpin, *mut sqlite3: Unpin, Arc<Mutex<*mut sqlite3>>: Unpin, *const Node<Arc<str>, RawStatement> is !null: Unpin, Arc<InnerClientHandle>: Unpin, Arc<MediaLock>: Unpin, *mut Counter<Channel<Result<(Value, bool), Error>>>: Unpin, *mut Counter<Channel<Result<(Value, bool), Error>>>: Unpin, *mut Counter<Channel<Result<(Value, bool), Error>>>: Unpin, *mut Counter<Channel<Result<String, Error>>>: Unpin, *mut Counter<Channel<Result<String, Error>>>: Unpin, *mut Counter<Channel<Result<String, Error>>>: Unpin, *mut Counter<Channel<Result<(String, Option<Playlist>), Error>>>: Unpin, *mut Counter<Channel<Result<(String, Option<Playlist>), Error>>>: Unpin, *mut Counter<Channel<Result<(String, Option<Playlist>), Error>>>: Unpin, Arc<Playlist>: Unpin, *mut Counter<Channel<Result<(Option<Episode>, u64, HashSet<String>), Error>>>: Unpin, *mut Counter<Channel<Result<(Option<Episode>, u64, HashSet<String>), Error>>>: Unpin, *mut Counter<Channel<Result<(Option<Episode>, u64, HashSet<String>), Error>>>: Unpin, *mut Counter<Channel<Result<Option<Station>, Error>>>: Unpin, *mut Counter<Channel<Result<Option<Station>, Error>>>: Unpin, *mut Counter<Channel<Result<Option<Station>, Error>>>: Unpin, *mut Counter<Channel<Result<(), Error>>>: Unpin, *mut Counter<Channel<Result<(), Error>>>: Unpin, *mut Counter<Channel<Result<(), Error>>>: Unpin, I32NotAllOnes: Unpin, *mut Counter<Channel<Result<Player, Error>>>: Unpin, *mut Counter<Channel<Result<Player, Error>>>: Unpin, *mut Counter<Channel<Result<Player, Error>>>: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, *mut Counter<Channel<Result<Recording, Error>>>: Unpin, *mut Counter<Channel<Result<Recording, Error>>>: Unpin, *mut Counter<Channel<Result<Recording, Error>>>: Unpin, Arc<Mutex<String>>: Unpin,

§

impl UnsafeUnpin for Engine
where *const ArcInner<Atomic<bool>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin, *mut Counter<Channel<Result<Value, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Value, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Value, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<BrowsePage>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<BrowsePage>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<BrowsePage>, Error>>>: UnsafeUnpin, *const ArcInner<BrowseFileProbe> is !null: UnsafeUnpin, PhantomData<ArcInner<BrowseFileProbe>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Result<Value, Error>>: UnsafeUnpin, PhantomData<(String, Background<Value>)>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const ArcInner<Atomic<u64>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<u64>>>: UnsafeUnpin, *const ArcInner<Captions> is !null: UnsafeUnpin, PhantomData<ArcInner<Captions>>: UnsafeUnpin, PhantomData<Chapter>: UnsafeUnpin, PhantomData<Transcript>: UnsafeUnpin, PhantomData<(String, Background<Download>)>: UnsafeUnpin, *mut Counter<Channel<Result<(Vec<Download>, Vec<Feed>), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(Vec<Download>, Vec<Feed>), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(Vec<Download>, Vec<Feed>), Error>>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, *const ArcInner<Shared> is !null: UnsafeUnpin, PhantomData<ArcInner<Shared>>: UnsafeUnpin, *const ArcInner<Inner> is !null: UnsafeUnpin, PhantomData<ArcInner<Inner>>: UnsafeUnpin, *const ArcInner<Packet<'static, ()>> is !null: UnsafeUnpin, PhantomData<ArcInner<Packet<'static, ()>>>: UnsafeUnpin, *const ArcInner<VecDeque<Segment>> is !null: UnsafeUnpin, PhantomData<ArcInner<VecDeque<Segment>>>: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, *mut Counter<Channel<Result<bool, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<bool, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<bool, Error>>>: UnsafeUnpin, *mut Counter<Channel<Notice>>: UnsafeUnpin, *mut Counter<Channel<Notice>>: UnsafeUnpin, *mut Counter<Channel<Notice>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Vec<Segment>>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Vec<Segment>>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Vec<Segment>>, Error>>>: UnsafeUnpin, PhantomData<Background<bool>>: UnsafeUnpin, *const ArcInner<Mutex<VerificationCache>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<VerificationCache>>>: UnsafeUnpin, PhantomData<u64>: UnsafeUnpin, *const ArcInner<Inner<()>> is !null: UnsafeUnpin, PhantomData<ArcInner<Inner<()>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Metadata>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Metadata>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Metadata>, Error>>>: UnsafeUnpin, *mut sqlite3: UnsafeUnpin, *const ArcInner<Mutex<*mut sqlite3>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<*mut sqlite3>>>: UnsafeUnpin, PhantomData<NonNull<Node<Arc<str>, RawStatement>>>: UnsafeUnpin, *const Node<Arc<str>, RawStatement> is !null: UnsafeUnpin, *const ArcInner<InnerClientHandle> is !null: UnsafeUnpin, PhantomData<ArcInner<InnerClientHandle>>: UnsafeUnpin, *const ArcInner<MediaLock> is !null: UnsafeUnpin, PhantomData<ArcInner<MediaLock>>: UnsafeUnpin, *mut Counter<Channel<Result<(Value, bool), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(Value, bool), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(Value, bool), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<String, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<String, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<String, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(String, Option<Playlist>), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(String, Option<Playlist>), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(String, Option<Playlist>), Error>>>: UnsafeUnpin, *const ArcInner<Playlist> is !null: UnsafeUnpin, PhantomData<ArcInner<Playlist>>: UnsafeUnpin, PhantomData<(String, Episode)>: UnsafeUnpin, PhantomData<Completion>: UnsafeUnpin, *mut Counter<Channel<Result<(Option<Episode>, u64, HashSet<String>), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(Option<Episode>, u64, HashSet<String>), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(Option<Episode>, u64, HashSet<String>), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Station>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Station>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Option<Station>, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(), Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<(), Error>>>: UnsafeUnpin, I32NotAllOnes: UnsafeUnpin, *mut Counter<Channel<Result<Player, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Player, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Player, Error>>>: UnsafeUnpin, PhantomData<Background<()>>: UnsafeUnpin, PhantomData<Instant>: UnsafeUnpin, *const LeafNode<String, String> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, String)>>: UnsafeUnpin, PhantomData<Background<Value>>: UnsafeUnpin, *mut Counter<Channel<Result<Recording, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Recording, Error>>>: UnsafeUnpin, *mut Counter<Channel<Result<Recording, Error>>>: UnsafeUnpin, PhantomData<JoinHandle<()>>: UnsafeUnpin, *const ArcInner<Mutex<String>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<String>>>: UnsafeUnpin,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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, !>

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more