pub struct RobloxStudioPaths { /* private fields */ }Expand description
References to discovered, validated paths to the current Roblox Studio executable, content, and plugins directories.
Can be cheaply cloned and shared between threads.
Implementations§
Source§impl RobloxStudioPaths
impl RobloxStudioPaths
Sourcepub fn new() -> RobloxStudioResult<Self>
pub fn new() -> RobloxStudioResult<Self>
Tries to locate the current Roblox Studio installation and directories.
§Errors
- If Roblox Studio is not installed.
Examples found in repository?
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let paths = RobloxStudioPaths::new()?;
5
6 println!("Paths to current Roblox Studio installation:");
7 println!();
8 println!("- Executable: {}", paths.exe().display());
9 println!("- Content: {}", paths.content().display());
10 println!("- Built-in Plugins: {}", paths.built_in_plugins().display());
11 println!("- User Plugins: {}", paths.user_plugins().display());
12
13 Ok(())
14}Sourcepub fn exe(&self) -> &Path
pub fn exe(&self) -> &Path
Returns the path to the Roblox Studio executable.
Examples found in repository?
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let paths = RobloxStudioPaths::new()?;
5
6 println!("Paths to current Roblox Studio installation:");
7 println!();
8 println!("- Executable: {}", paths.exe().display());
9 println!("- Content: {}", paths.content().display());
10 println!("- Built-in Plugins: {}", paths.built_in_plugins().display());
11 println!("- User Plugins: {}", paths.user_plugins().display());
12
13 Ok(())
14}Sourcepub fn content(&self) -> &Path
pub fn content(&self) -> &Path
Returns the path to the Roblox Studio content directory.
This directory contains Roblox bundled assets, in sub-directories such as:
fonts- bundled font files, typically in OpenType or TrueType formatsounds- bundled basic sounds, such as the character reset soundtextures- bundled texture files, typically used forCoreGui
Examples found in repository?
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let paths = RobloxStudioPaths::new()?;
5
6 println!("Paths to current Roblox Studio installation:");
7 println!();
8 println!("- Executable: {}", paths.exe().display());
9 println!("- Content: {}", paths.content().display());
10 println!("- Built-in Plugins: {}", paths.built_in_plugins().display());
11 println!("- User Plugins: {}", paths.user_plugins().display());
12
13 Ok(())
14}Sourcepub fn user_plugins(&self) -> &Path
pub fn user_plugins(&self) -> &Path
Returns the path to the Roblox Studio user plugins directory.
For the path to built-in plugins, see RobloxStudioPaths::built_in_plugins.
§Warning
This directory may or may not exist as it is created on demand, either when a user opens it through the Roblox Studio settings, or when they install their first plugin.
Examples found in repository?
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let paths = RobloxStudioPaths::new()?;
5
6 println!("Paths to current Roblox Studio installation:");
7 println!();
8 println!("- Executable: {}", paths.exe().display());
9 println!("- Content: {}", paths.content().display());
10 println!("- Built-in Plugins: {}", paths.built_in_plugins().display());
11 println!("- User Plugins: {}", paths.user_plugins().display());
12
13 Ok(())
14}Sourcepub fn built_in_plugins(&self) -> &Path
pub fn built_in_plugins(&self) -> &Path
Returns the path to the Roblox Studio built-in plugins directory.
These plugins are bundled with Roblox Studio itself, and the directory is guaranteed
to exist unlike the user plugins directory (RobloxStudioPaths::user_plugins).
Examples found in repository?
3pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let paths = RobloxStudioPaths::new()?;
5
6 println!("Paths to current Roblox Studio installation:");
7 println!();
8 println!("- Executable: {}", paths.exe().display());
9 println!("- Content: {}", paths.content().display());
10 println!("- Built-in Plugins: {}", paths.built_in_plugins().display());
11 println!("- User Plugins: {}", paths.user_plugins().display());
12
13 Ok(())
14}Trait Implementations§
Source§impl Clone for RobloxStudioPaths
impl Clone for RobloxStudioPaths
Source§fn clone(&self) -> RobloxStudioPaths
fn clone(&self) -> RobloxStudioPaths
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more