pub struct SortedMsgTable { /* private fields */ }
Expand description

A type for collecting the parts needed to send a struct over the network.

This is a variation of MsgTable. You should use this type only when you don’t know the order of registration. In place of a constant registration order, types must be registered with a unique string identifier. The list is then sorted on this identifier when built.

If a type is registered with the same name, it will be ignored, therefore namespacing is encouraged if you are allowing mods or external plugins to add networking types.

IMPORTANT: The Message tables on all clients and the server need to have exactly the same types registered, although they do not need to be registered in the same order.

Implementations

Creates a new SortedMsgTable.

Adds all registrations from other into this table.

All errors are thrown before mutating self. If no errors are thrown, all entries are added; if an error is thrown, no entries are added.

If type T has been registered or not.

If the type with TypeId tid has been registered or not.

If the type with TypeId tid has been registered or not.

Registers a message type so that it can be sent over the network.

Builds the SortedMsgTable into useful parts.

Consumes the Message table, and turns it into a MsgTableParts.

This should be called with the generic parameters:

  • C is the connection message type.
  • R is the response message type.
  • f is the disconnect message type.

The generic parameters should not be registered before hand.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.