pub struct OwnedServer {
Show 21 fields pub id: String, pub active_plugins: Vec<String>, pub backup_slots: usize, pub categories: Vec<String>, pub connected_servers: Vec<String>, pub creation: usize, pub credits_per_day: f32, pub installed_content: Vec<InstalledContent>, pub last_online: usize, pub motd: String, pub name: String, pub name_lower: String, pub owner: String, pub platform: String, pub proxy: bool, pub purchased_icons: Vec<String>, pub server_plan: String, pub server_properties: ServerProperties, pub server_version_type: String, pub suspended: bool, pub visibility: bool,
}
Expand description

This represents servers owned by an authenticated user using the Client struct. Closely resembles the Server struct with slight modifications allowing more information to be seen.

Fields

id: Stringactive_plugins: Vec<String>

List of plugins.

backup_slots: usize

Number of back up slots.

categories: Vec<String>

List of categories.

connected_servers: Vec<String>

List of connected server IDs.

creation: usize

Time the server was created.

credits_per_day: f32

Credits spent to host server per day.

installed_content: Vec<InstalledContent>

List of installed contents.

last_online: usize

When it was last online.

motd: String

MOTD of the server.

name: String

Name of server.

name_lower: String

Lower case name of server

owner: String

Owner of server.

platform: String

Platform of server.

proxy: bool

Whether server uses a proxy.

purchased_icons: Vec<String>

List of purchased icon IDs.

server_plan: String

Server plan name.

server_properties: ServerProperties

Server properties of the server.

server_version_type: String

Server version type.

suspended: bool

Wether server is suspended.

visibility: bool

Wether server was visible.

Implementations

Start an owned server and takes it out of hibernation.

Arguments
  • client - Instance of calling Client struct.
Example
match client.my_server("server-name").await?.start_service(&client).await {
    Err(_) => println!("Could not start server"),
    Ok(_) => prinln!("Started server!")
}
Error

Returns a FailedOp error if it could not post data. This usually happens if you are not allowed to start the server.

Stop an owned server and hibernate it.

Arguments
  • client - Instance of calling Client struct.
Example
match client.my_server("server-name").await?.destroy_service(&client).await {
    Err(_) => println!("Failed to stop server"),
    Ok(_) => println!("Hibernating server")
}
Error

Returns a FailedOp error if it could not post data. This usually happens if you are not allowed to stop the server.

Start an owned server and hibernate it.

Arguments
  • client - Instance of calling Client struct.
Example
match client.my_server("server-name").await?.start(&client).await {
    Err(e) => println!("Something went wrong whilst starting server: {e}"),
    Ok(_) => println!("Started server, nice.")
}
Error

Returns a FailedOp error if it could not post data. This usually happens if you are not allowed to start the server.

Stops a server without hibernating the server.

Arguments
  • client - Instance of calling Client struct.
Example
if let Ok(_) = client.my_server("server-name").await?.shut_down(&client).await {
    println!("Successfully stopped server");
}
Error

Returns a FailedOp error if it could not post data. This usually happens if you are not allowed to shut the server down/

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. 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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more