pub struct MediaLibraryChangeStream { /* private fields */ }Available on crate feature
async only.Expand description
Stream of NotificationEvents fired when the media library changes.
Wraps MPMediaLibraryDidChangeNotification.
macOS note:
MPMediaLibraryis iOS/tvOS-only so this notification never fires on macOS; the stream will be open but idle.
Implementations§
Source§impl MediaLibraryChangeStream
impl MediaLibraryChangeStream
Sourcepub fn subscribe(capacity: usize) -> Self
pub fn subscribe(capacity: usize) -> Self
Subscribe with an internal ring buffer of capacity slots.
Sourcepub fn next(&self) -> NextItem<'_, NotificationEvent>
pub fn next(&self) -> NextItem<'_, NotificationEvent>
Await the next event.
Sourcepub fn try_next(&self) -> Option<NotificationEvent>
pub fn try_next(&self) -> Option<NotificationEvent>
Non-blocking poll.
Sourcepub fn buffered_count(&self) -> usize
pub fn buffered_count(&self) -> usize
Number of events currently buffered.
Auto Trait Implementations§
impl Freeze for MediaLibraryChangeStream
impl RefUnwindSafe for MediaLibraryChangeStream
impl Send for MediaLibraryChangeStream
impl Sync for MediaLibraryChangeStream
impl Unpin for MediaLibraryChangeStream
impl UnsafeUnpin for MediaLibraryChangeStream
impl UnwindSafe for MediaLibraryChangeStream
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