Struct minehut::models::OwnedServer
source · [−]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: String
active_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
sourceimpl OwnedServer
impl OwnedServer
sourcepub async fn start_service(&self, client: &Client) -> Result<(), Error>
pub async fn start_service(&self, client: &Client) -> Result<(), Error>
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.
sourcepub async fn destroy_service(&self, client: &Client) -> Result<(), Error>
pub async fn destroy_service(&self, client: &Client) -> Result<(), Error>
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.
sourcepub async fn start(&self, client: &Client) -> Result<(), Error>
pub async fn start(&self, client: &Client) -> Result<(), Error>
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.
sourcepub async fn shut_down(&self, client: &Client) -> Result<(), Error>
pub async fn shut_down(&self, client: &Client) -> Result<(), Error>
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
sourceimpl Debug for OwnedServer
impl Debug for OwnedServer
sourceimpl<'de> Deserialize<'de> for OwnedServer
impl<'de> Deserialize<'de> for OwnedServer
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for OwnedServer
impl Send for OwnedServer
impl Sync for OwnedServer
impl Unpin for OwnedServer
impl UnwindSafe for OwnedServer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more