Skip to main content

Event

Enum Event 

Source
pub enum Event {
Show 15 variants ShuttingDown, ServerAddresses { addrs: Vec<SocketAddr>, relays: Vec<String>, lookup: Option<String>, }, PlaybackShare { handle: PlaybackHandle, max_bitrate: Option<u64>, }, PlaylistChanged { id: String, revision: u64, }, PlaylistGone { id: String, }, PinsChanged, LikedChanged, SubtitleTimingChanged { id: MediaId, track: u32, timing: SubtitleTiming, }, DownloadChanged { id: String, state: DownloadState, }, LibrariesChanged, PlaybackEnded { handle: PlaybackHandle, error: Error, }, ProfileRemoved { user: String, }, PinChanged { user: String, required: bool, }, WatchChanged { items: Vec<MediaId>, }, Unknown,
}
Expand description

Something the server tells the client without being asked, on the events stream.

Variants§

§

ShuttingDown

The server is stopping; the connection will close.

§

ServerAddresses

Where this server can be reached, pushed to a connection as soon as it is signed in, and again whenever the list changes. Each one is the whole list: it replaces what was told before. Never sent to a connection that is not signed in.

Fields

§addrs: Vec<SocketAddr>

The addresses network.announce tells, with their port, as text: 192.168.1.10:4433 or [2001:db8::1]:4433.

§relays: Vec<String>

The URLs of the iroh relays the server may use (network.relays), its home relay now first; empty while relays are off.

§lookup: Option<String>

The pkarr relay the server publishes where it is to (network.pkarr), for the device to look it up by its key when nothing else reaches it; None while it publishes nothing.

§

PlaybackShare

Playback handle’s share of the server’s WAN uplink changed: another WAN playback started or ended, or the budget changed. A playback in Quality::Auto re-plans with ChangeQuality at its position (the SDK’s managed playback does it by itself); max_bitrate is the new cap, None none. Sent only for a move of 15% or more, a few seconds after the last start or end. One of another quality may ignore it.

Fields

§max_bitrate: Option<u64>
§

PlaylistChanged

A playlist the user sees was made or changed: its entries, name, kinds or sharing. Read it again if it is shown. Only to a client that listed spoolframe:playlists.

Fields

§revision: u64
§

PlaylistGone

A playlist the user saw is gone to them: deleted, or no longer shared with them. Close it if it is shown.

Fields

§

PinsChanged

The user’s Pinned, or its notes, changed on another device or by another user’s change: ListPlaylists again.

§

LikedChanged

The user liked or unliked a track, on any device: a device that downloaded Liked asks what it holds now (MusicDownloadChanges). Only to the user’s own connections that listed spoolframe:music-downloads.

§

SubtitleTimingChanged

Item id’s subtitle track is timed anew: synced, its sync done or set aside, or its offset changed, by anyone. What it is served with changed: a player showing it reads it again (a ReadSubtitle in progress answers SubtitleChanged), with no restart. Only to a client that listed spoolframe:subtitle-sync, on a connection that asked for the item’s Tracks or plays it.

Fields

§track: u32
§

DownloadChanged

Download id’s state moved: waiting, then converting (told once per percent or every 2 s), writing, and ready or failed. Only to the connections of the user whose it is, that listed spoolframe:downloads.

Fields

§

LibrariesChanged

Experimental (federation): the libraries changed: a paired server came online or went offline, or shared or stopped sharing a library. Libraries again. Only to a client that named the feature.

§

PlaybackEnded

Experimental (federation): playback handle, of a paired server’s item, ended other than by its client’s stop: stopped by an admin, idle past the limit, its session or its grant ended, or, on the user’s own server playing it on, ended where it plays from. error is what the client’s next use of it is told (PlaybackStopped: do not start it again). Only for a play token’s session’s playbacks, and those played through the user’s own server.

Fields

§error: Error
§

ProfileRemoved

The profile of local user user (a user id, as WhoAmI names it) is gone from this device: the user was disabled or deleted, or an admin forgot this device for them. Their sessions here end with it; the next request in one is Unauthenticated. Leave the profile, and offer to sign in again only if the user is not deleted. Only to that user’s connections, and sent only to a connection where the spoolframe:profile-events feature is on (both sides named it).

Fields

§user: String
§

PinChanged

Local user user’s PIN changed: set, changed or removed, by them on another device or by an admin. required is whether they have a PIN now. A device that has their profile unlocked locks it again where the PIN is asked for; one that kept the old PIN to check offline forgets it. Only to that user’s connections, not the one that made the change, and sent only to a connection where the spoolframe:profile-events feature is on (both sides named it).

Fields

§user: String
§required: bool
§

WatchChanged

The user’s watch state of items changed on another connection: marked watched or unwatched (a season’s or a show’s id marks its episodes), hidden from or put back in Continue watching, synced from offline, or played into progress, to watched, or stopped (not each progress report). Read again what shows them (Home, an item’s page). Only to that user’s other connections, and sent only to a connection where the spoolframe:watch-events feature is on (both sides named it).

Fields

§items: Vec<MediaId>
§

Unknown

An event type this build does not know; ignore it.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Event

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Event

Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Event

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.