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
impl Game
sourcepub async fn servers(&mut self) -> Vec<Server>
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();
}
sourcepub async fn create_dev_product(
&mut self,
name: &str,
price: u32
) -> ApiResult<DevProduct>
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<'de> Deserialize<'de> for Game
impl<'de> Deserialize<'de> for Game
source§fn 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 Game
impl Send for Game
impl Sync for Game
impl Unpin for Game
impl !UnwindSafe for Game
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more