Enum ggrs::GGRSEvent

source ·
pub enum GGRSEvent<T>where
    T: Config,{
    Synchronizing {
        addr: T::Address,
        total: u32,
        count: u32,
    },
    Synchronized {
        addr: T::Address,
    },
    Disconnected {
        addr: T::Address,
    },
    NetworkInterrupted {
        addr: T::Address,
        disconnect_timeout: u128,
    },
    NetworkResumed {
        addr: T::Address,
    },
    WaitRecommendation {
        skip_frames: u32,
    },
    DesyncDetected {
        frame: Frame,
        local_checksum: u128,
        remote_checksum: u128,
        addr: T::Address,
    },
}
Expand description

Notifications that you can receive from the session. Handling them is up to the user.

Variants§

§

Synchronizing

Fields

§addr: T::Address

The address of the endpoint.

§total: u32

Total number of required successful synchronization steps.

§count: u32

Current number of successful synchronization steps.

The session made progress in synchronizing. After total roundtrips, the session are synchronized.

§

Synchronized

Fields

§addr: T::Address

The address of the endpoint.

The session is now synchronized with the remote client.

§

Disconnected

Fields

§addr: T::Address

The address of the endpoint.

The remote client has disconnected.

§

NetworkInterrupted

Fields

§addr: T::Address

The address of the endpoint.

§disconnect_timeout: u128

The client will be disconnected in this amount of ms.

The session has not received packets from the remote client for some time and will disconnect the remote in disconnect_timeout ms.

§

NetworkResumed

Fields

§addr: T::Address

The address of the endpoint.

Sent only after a GGRSEvent::NetworkInterrupted event, if communication with that player has resumed.

§

WaitRecommendation

Fields

§skip_frames: u32

Amount of frames recommended to be skipped in order to let other clients catch up.

Sent out if GGRS recommends skipping a few frames to let clients catch up. If you receive this, consider waiting skip_frames number of frames.

§

DesyncDetected

Fields

§frame: Frame

Frame of the checksums

§local_checksum: u128

local checksum for the given frame

§remote_checksum: u128

remote checksum for the given frame

§addr: T::Address

remote address of the endpoint.

Sent whenever GGRS locally detected a discrepancy between local and remote checksums

Trait Implementations§

source§

impl<T> Clone for GGRSEvent<T>where T: Config + Clone, T::Address: Clone,

source§

fn clone(&self) -> GGRSEvent<T>

Returns a copy 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<T> Debug for GGRSEvent<T>where T: Config + Debug, T::Address: Debug,

source§

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

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

impl<T> PartialEq<GGRSEvent<T>> for GGRSEvent<T>where T: Config + PartialEq, T::Address: PartialEq,

source§

fn eq(&self, other: &GGRSEvent<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Copy for GGRSEvent<T>where T: Config + Copy, T::Address: Copy,

source§

impl<T> Eq for GGRSEvent<T>where T: Config + Eq, T::Address: Eq,

source§

impl<T> StructuralEq for GGRSEvent<T>where T: Config,

source§

impl<T> StructuralPartialEq for GGRSEvent<T>where T: Config,

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for GGRSEvent<T>where <T as Config>::Address: RefUnwindSafe,

§

impl<T> Send for GGRSEvent<T>where <T as Config>::Address: Send,

§

impl<T> Sync for GGRSEvent<T>where <T as Config>::Address: Sync,

§

impl<T> Unpin for GGRSEvent<T>where <T as Config>::Address: Unpin,

§

impl<T> UnwindSafe for GGRSEvent<T>where <T as Config>::Address: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V