pub struct Client {
pub session: Https,
}
Fields§
§session: Https
Implementations§
source§impl Client
impl Client
setCookie
Set the cookie for the client; This function is needed to execute specific API requests such as .create_developer_product()
Example
let COOKIE: &str = "_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_8B1028";
#[tokio::main]
async fn main() {
let mut client = robloxapi::Client();
client.set_cookie(COOKIE).await;
}
source§impl Client
impl Client
sourcepub async fn user(&mut self, builder: impl UserBuilder) -> User
pub async fn user(&mut self, builder: impl UserBuilder) -> User
Create a new user given user_id
Example
#[tokio::main]
async fn main() {
let mut client = robloxapi::Client::new();
let user = client.user(242872495).await;
}
sourcepub async fn current_user(self: &mut Client) -> User
pub async fn current_user(self: &mut Client) -> User
Get the current user. Must be logged in with a cookie to get current_user
Example
#[tokio::main]
async fn main() {
let COOKIE: &str = "";
let mut client = robloxapi::Client::new();
client.set_cookie(COOKIE).await;
let current_user = client.current_user().await;
}
sourcepub async fn game(&self, builder: impl GameBuilder) -> ApiResult<Game>
pub async fn game(&self, builder: impl GameBuilder) -> ApiResult<Game>
Returns a Game struct given the place ID. Get information about a game.
Example
#[tokio::main]
async fn main() {
let place_id = 7415484311; // Place ID for game
let mut client = robloxapi::Client::new(); // Initialize a new client instance
// Create a new game given place id
let game = client.game(place_id).await;
}
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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