SResourceUpdate

Enum SResourceUpdate 

Source
pub enum SResourceUpdate<'a> {
Show 20 variants Resource(Cow<'a, Resource>), Throttle { id: String, kind: ResourceKind, throttle_up: Option<i64>, throttle_down: Option<i64>, }, Rate { id: String, kind: ResourceKind, rate_up: u64, rate_down: u64, }, UserData { id: String, kind: ResourceKind, user_data: Value, }, ServerTransfer { id: String, kind: ResourceKind, rate_up: u64, rate_down: u64, transferred_up: u64, transferred_down: u64, ses_transferred_up: u64, ses_transferred_down: u64, }, ServerSpace { id: String, kind: ResourceKind, free_space: u64, }, ServerToken { id: String, kind: ResourceKind, download_token: String, }, TorrentStatus { id: String, kind: ResourceKind, error: Option<String>, status: Status, }, TorrentTransfer { id: String, kind: ResourceKind, rate_up: u64, rate_down: u64, transferred_up: u64, transferred_down: u64, progress: f32, }, TorrentPeers { id: String, kind: ResourceKind, peers: u16, availability: f32, }, TorrentPicker { id: String, kind: ResourceKind, strategy: Strategy, }, TorrentPriority { id: String, kind: ResourceKind, priority: u8, }, TorrentPath { id: String, kind: ResourceKind, path: String, }, TorrentPieces { id: String, kind: ResourceKind, piece_field: String, }, TrackerStatus { id: String, kind: ResourceKind, last_report: DateTime<Utc>, error: Option<String>, }, FilePriority { id: String, kind: ResourceKind, priority: u8, }, FileProgress { id: String, kind: ResourceKind, progress: f32, }, PieceAvailable { id: String, kind: ResourceKind, available: bool, }, PieceDownloaded { id: String, kind: ResourceKind, downloaded: bool, }, PeerAvailability { id: String, kind: ResourceKind, availability: f32, },
}
Expand description

To increase server->client update efficiency, we encode common partial updates to resources with this enum.

Variants§

§

Resource(Cow<'a, Resource>)

§

Throttle

Fields

§throttle_up: Option<i64>
§throttle_down: Option<i64>
§

Rate

Fields

§rate_up: u64
§rate_down: u64
§

UserData

Fields

§user_data: Value
§

ServerTransfer

Fields

§rate_up: u64
§rate_down: u64
§transferred_up: u64
§transferred_down: u64
§ses_transferred_up: u64
§ses_transferred_down: u64
§

ServerSpace

Fields

§free_space: u64
§

ServerToken

Fields

§download_token: String
§

TorrentStatus

Fields

§status: Status
§

TorrentTransfer

Fields

§rate_up: u64
§rate_down: u64
§transferred_up: u64
§transferred_down: u64
§progress: f32
§

TorrentPeers

Fields

§peers: u16
§availability: f32
§

TorrentPicker

Fields

§strategy: Strategy
§

TorrentPriority

Fields

§priority: u8
§

TorrentPath

Fields

§path: String
§

TorrentPieces

Fields

§piece_field: String
§

TrackerStatus

Fields

§last_report: DateTime<Utc>
§

FilePriority

Fields

§priority: u8
§

FileProgress

Fields

§progress: f32
§

PieceAvailable

Fields

§available: bool
§

PieceDownloaded

Fields

§downloaded: bool
§

PeerAvailability

Fields

§availability: f32

Implementations§

Source§

impl<'a> SResourceUpdate<'a>

Source

pub fn id(&self) -> &str

Trait Implementations§

Source§

impl<'a> Clone for SResourceUpdate<'a>

Source§

fn clone(&self) -> SResourceUpdate<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for SResourceUpdate<'a>

Source§

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

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

impl<'de, 'a> Deserialize<'de> for SResourceUpdate<'a>

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<'a> PartialEq for SResourceUpdate<'a>

Source§

fn eq(&self, other: &SResourceUpdate<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Serialize for SResourceUpdate<'a>

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<'a> StructuralPartialEq for SResourceUpdate<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for SResourceUpdate<'a>

§

impl<'a> RefUnwindSafe for SResourceUpdate<'a>

§

impl<'a> Send for SResourceUpdate<'a>

§

impl<'a> Sync for SResourceUpdate<'a>

§

impl<'a> Unpin for SResourceUpdate<'a>

§

impl<'a> UnwindSafe for SResourceUpdate<'a>

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<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> 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> 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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,