Struct robloxapi::Game

source ·
pub struct Game {
Show 18 fields pub client: Https, pub servers: Option<Vec<Server>>, pub universe_id: u64, pub place_id: u64, pub name: String, pub description: String, pub price: Option<u64>, pub allowed_gear_genres: Vec<String>, pub allowed_gear_categories: Vec<String>, pub playing: u32, pub visits: u64, pub max_players: u8, pub created: String, pub updated: String, pub studio_access_to_apis_allowed: bool, pub create_vip_servers_allowed: bool, pub universe_avatar_type: String, pub genre: String,
}

Fields§

§client: Https§servers: Option<Vec<Server>>§universe_id: u64§place_id: u64§name: String§description: String§price: Option<u64>§allowed_gear_genres: Vec<String>§allowed_gear_categories: Vec<String>§playing: u32§visits: u64§max_players: u8§created: String§updated: String§studio_access_to_apis_allowed: bool§create_vip_servers_allowed: bool§universe_avatar_type: String§genre: String

Implementations§

source§

impl Game

source

pub async fn servers(&mut self) -> Vec<Server>

Get a list of servers from the Game

Example

#[tokio::main]
async fn main() {
     
    // Place ID
    let game_id = 7415484311;
    let mut client = robloxapi::Client::new();
    // List of servers
    let servers = client.game(game_id)
        .await
        .unwrap()
        .servers();
}
source

pub async fn create_dev_product( &mut self, name: &str, price: u32 ) -> ApiResult<DevProduct>

Create a developer product given name and price.

Example
#[tokio::main]
async fn main() {
    let mut client = robloxapi::Client::new();
    client.set_cookie(COOKIE).await;

    // Create a new game with place id 100000
    let mut game = client.game(100000).await.unwrap();
     // Requires client to be logged in with a cookie
    match game.create_dev_product(
        "devproduct1", // Name of the devproduct
        500, // Price of the devproduct
    ).await {
        Err(_err) => {
            todo!() // Handle the error
        }
        Ok(dev_product) => {
            todo!() // Use the DevProduct
        }
    };
}

Trait Implementations§

source§

impl Clone for Game

source§

fn clone(&self) -> Game

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 Debug for Game

source§

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

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

impl<'de> Deserialize<'de> for Game

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Game

source§

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

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

impl Serialize for Game

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Game

§

impl Send for Game

§

impl Sync for Game

§

impl Unpin for Game

§

impl !UnwindSafe for Game

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

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

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.
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.
source§

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

Performs the conversion.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,