pub struct Server {
    pub port: u16,
    pub addr: String,
    pub started: bool,
    /* private fields */
}
Expand description

A websocket server for Voxelize, holds all worlds data, and runs as a background system service.

Fields

port: u16

The port that this voxelize server is running on.

addr: String

The address that this voxelize server is running on.

started: bool

Whether or not if the socket server has started as a system service.

Implementations

Create a new Voxelize server instance used to host all the worlds.

Example
// Create a server of port 4000 on "0.0.0.0"
let server = Server::new().addr("0.0.0.0").port(4000).build();

// Run the server on Voxelize
Voxelize::run(server);

Get ready to start the Voxelize server.

Assign a network handler to this server

Add an endpoint, without assigning them to a world. Endpoint(client) needs to pass a CONNECT type protocol buffer with a world name to be assigned to a world.

Add a world instance to the server. Different worlds have different configurations, and can hold their own set of clients within. If the server has already started, the added world will be started right away.

Create a world in the server. Different worlds have different configurations, and can hold their own set of clients within. If the server has already started, the added world will be started right away.

Get a world reference by name.

Get a mutable world reference by name.

Handler for client’s message.

Handler for client leaving.

Obtain the network handler.

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 alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

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.