Skip to main content

RobloxStudioOpener

Struct RobloxStudioOpener 

Source
pub struct RobloxStudioOpener { /* private fields */ }
Expand description

A builder to open a Roblox Studio instance through the official binary, while also properly handling its CLI arguments and intricacies.

Implementations§

Source§

impl RobloxStudioOpener

Source

pub fn new() -> Self

Create a new Roblox Studio opener.

Examples found in repository?
examples/open_file.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5
6    RobloxStudioOpener::new().open_file(file_path)?.run()?;
7
8    Ok(())
9}
More examples
Hide additional examples
examples/start_server.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5
6    RobloxStudioOpener::new().start_server(file_path)?.run()?;
7
8    Ok(())
9}
examples/start_client.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // NOTE: A server must already be running for this to work
5
6    RobloxStudioOpener::new().start_client().run()?;
7
8    Ok(())
9}
examples/open_online_place.rs (line 7)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let universe_id: u64 = 123456789;
5    let place_id: u64 = 234567890;
6
7    RobloxStudioOpener::new()
8        .open_place(universe_id, place_id)
9        .run()?;
10
11    Ok(())
12}
examples/start_server_with_clients.rs (line 7)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5    let num_clients = 4;
6
7    RobloxStudioOpener::new()
8        .start_server_with_clients(file_path, num_clients)?
9        .run()?;
10
11    Ok(())
12}
Source

pub fn with_server_addr<A>(self, server_addr: A) -> Self
where A: Into<Ipv4Addr>,

Sets a custom server address to use with the start_server, start_server_with_place, or start_client methods.

Defaults to localhost (127.0.0.1).

Source

pub fn with_server_port(self, server_port: u16) -> Self

Sets a custom server port to use with the start_server, start_server_with_place, or start_client methods.

Defaults to port 50608.

Source

pub fn open_place(self, universe_id: u64, place_id: u64) -> Self

Edit an online place in Roblox Studio.

This will open the place with the given universe_id and place_id.

Examples found in repository?
examples/open_online_place.rs (line 8)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let universe_id: u64 = 123456789;
5    let place_id: u64 = 234567890;
6
7    RobloxStudioOpener::new()
8        .open_place(universe_id, place_id)
9        .run()?;
10
11    Ok(())
12}
Source

pub fn open_file<P>(self, file_path: P) -> RobloxStudioResult<Self>
where P: AsRef<Path>,

Edit a local place file in Roblox Studio.

This will open the place file at the given file_path.

§Errors
  • If the given file_path cannot be canonicalized.
  • If the given file_path cannot be converted to a string.
Examples found in repository?
examples/open_file.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5
6    RobloxStudioOpener::new().open_file(file_path)?.run()?;
7
8    Ok(())
9}
Source

pub fn start_server<P>(self, file_path: P) -> RobloxStudioResult<Self>
where P: AsRef<Path>,

Start a server in Roblox Studio with the given place file.

This will copy the place file at the given file_path to the Roblox server file, and then start the server.

§Errors
  • If the local data directory cannot be found.
  • If the given place file cannot be copied to the local data directory.
Examples found in repository?
examples/start_server.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5
6    RobloxStudioOpener::new().start_server(file_path)?.run()?;
7
8    Ok(())
9}
Source

pub fn start_server_with_clients<P>( self, file_path: P, num_clients: u8, ) -> RobloxStudioResult<Self>
where P: AsRef<Path>,

Start a server in Roblox Studio with the given place file and clients.

This will also automatically start the given number of clients.

See start_server for more information.

Examples found in repository?
examples/start_server_with_clients.rs (line 8)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5    let num_clients = 4;
6
7    RobloxStudioOpener::new()
8        .start_server_with_clients(file_path, num_clients)?
9        .run()?;
10
11    Ok(())
12}
Source

pub fn start_client(self) -> Self

Starts a single client, connecting to an already launched server.

See start_server for more information.

Examples found in repository?
examples/start_client.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // NOTE: A server must already be running for this to work
5
6    RobloxStudioOpener::new().start_client().run()?;
7
8    Ok(())
9}
Source

pub fn run(self) -> RobloxStudioResult<()>

Starts Roblox Studio with all of the given arguments.

Note that this will not wait for Roblox Studio to actually open the file/server/client - it only guarantees that the process has been spawned and that it has received the necessary arguments.

§Errors
  • If the Roblox Studio executable cannot be found.
Examples found in repository?
examples/open_file.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5
6    RobloxStudioOpener::new().open_file(file_path)?.run()?;
7
8    Ok(())
9}
More examples
Hide additional examples
examples/start_server.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5
6    RobloxStudioOpener::new().start_server(file_path)?.run()?;
7
8    Ok(())
9}
examples/start_client.rs (line 6)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // NOTE: A server must already be running for this to work
5
6    RobloxStudioOpener::new().start_client().run()?;
7
8    Ok(())
9}
examples/open_online_place.rs (line 9)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let universe_id: u64 = 123456789;
5    let place_id: u64 = 234567890;
6
7    RobloxStudioOpener::new()
8        .open_place(universe_id, place_id)
9        .run()?;
10
11    Ok(())
12}
examples/start_server_with_clients.rs (line 9)
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let file_path = "my_place_file.rbxl";
5    let num_clients = 4;
6
7    RobloxStudioOpener::new()
8        .start_server_with_clients(file_path, num_clients)?
9        .run()?;
10
11    Ok(())
12}

Trait Implementations§

Source§

impl Clone for RobloxStudioOpener

Source§

fn clone(&self) -> RobloxStudioOpener

Returns a duplicate 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 RobloxStudioOpener

Source§

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

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

impl Default for RobloxStudioOpener

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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 T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.