pub struct Queue { /* private fields */ }Implementations§
Source§impl Queue
impl Queue
pub const fn new() -> Self
pub fn add_song(&mut self, song: Song)
pub fn add_songs(&mut self, songs: Vec<Song>)
pub fn remove_song(&mut self, index: usize)
pub fn clear(&mut self)
pub fn current_song(&self) -> Option<&Song>
pub fn next_song(&mut self) -> Option<&Song>
Sourcepub fn skip_forward(&mut self, n: usize) -> Option<&Song>
pub fn skip_forward(&mut self, n: usize) -> Option<&Song>
Skip forward n songs in the queue.
progresses the current index by n, following the repeat mode rules.
pub fn previous_song(&mut self) -> Option<&Song>
pub fn skip_backward(&mut self, n: usize) -> Option<&Song>
pub fn set_repeat_mode(&mut self, repeat_mode: RepeatMode)
pub const fn get_repeat_mode(&self) -> RepeatMode
pub fn shuffle(&mut self)
pub fn get(&self, index: usize) -> Option<&Song>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub const fn current_index(&self) -> Option<usize>
pub fn queued_songs(&self) -> Box<[Song]>
Sourcepub fn set_current_index(&mut self, index: usize)
pub fn set_current_index(&mut self, index: usize)
Sets the current index, clamped to the nearest valid index.
Sourcepub fn remove_range(&mut self, range: Range<usize>)
pub fn remove_range(&mut self, range: Range<usize>)
Removes a range of songs from the queue. If the current index is within the range, it will be set to the next valid index (or the previous valid index if the range included the end of the queue).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Queue
impl<'de> Deserialize<'de> for Queue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Queue
impl RefUnwindSafe for Queue
impl Send for Queue
impl Sync for Queue
impl Unpin for Queue
impl UnwindSafe for Queue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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