Skip to main content

PeerRequest

Enum PeerRequest 

Source
pub enum PeerRequest {
    Hello(PeerHello),
    RedeemPairing(RedeemPairing),
    Unpaired(Unpaired),
    Libraries,
    SharesChanged,
    Sync(SyncLibrary),
    Artwork(ArtworkFetch),
    AssertUser(AssertUser),
    SearchSubtitles(SubtitleSearchAsk),
    DownloadSubtitle(SubtitleDownloadAsk),
    RemoveSubtitleDownload(SubtitleRemovalAsk),
    Unknown,
}
Expand description

A request on spoolframe/federation/1.

Variants§

§

Hello(PeerHello)

The first request on every connection: Info.

§

RedeemPairing(RedeemPairing)

A stranger’s only other request: Paired, or Refused.

§

Unpaired(Unpaired)

A paired server unpaired: Done, then the connection is closed with crate::close::UNPAIRED.

§

Libraries

A pair’s: the libraries shared with it now: Libraries.

§

SharesChanged

A pair’s: what the sender shares with the server it is sent to changed (a grant added or revoked), so that one syncs the sender soon rather than at its next interval. It carries nothing: the receiver asks Libraries and Sync as ever, at most once per SHARES_CHANGED_EVERY per pair, a notice within it waiting for its end and coalesced with any others. Done. Sent best effort, on the connection the sender holds to the pair: a pair not connected is not told, and syncs on connecting. A server that does not know it resets the stream NOT_ALLOWED, which changes nothing.

§

Sync(SyncLibrary)

A pair’s: one shared library’s changes: Pages on the same stream, the last with more: false; NotShared for a library that is not shared with it, Unavailable when it cannot be walked now.

§

Artwork(ArtworkFetch)

A pair’s: one image of an item in a library shared with it: Artwork, NotShared or NotFound, written as a reply (crate::codec::write_reply), not a frame.

§

AssertUser(AssertUser)

A pair’s: it vouches for one of its users, who wants an item of this server’s: Token, or AssertionRefused.

§

SearchSubtitles(SubtitleSearchAsk)

A pair’s: one of its users searches subtitles for an item of this server’s: SubtitleResults, or Failed.

§

DownloadSubtitle(SubtitleDownloadAsk)

A pair’s: one of its users downloads a result, counted under the pair: SubtitleDownloaded, or Failed.

§

RemoveSubtitleDownload(SubtitleRemovalAsk)

A pair’s: one of its users removes a downloaded subtitle: Done, or Failed.

§

Unknown

A request this build does not know: not allowed.

Trait Implementations§

Source§

impl Clone for PeerRequest

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 PeerRequest

Source§

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

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

impl<'de> Deserialize<'de> for PeerRequest

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 PeerRequest

Source§

impl PartialEq for PeerRequest

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 PeerRequest

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 PeerRequest

Auto Trait Implementations§

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.