pub enum RunContext {
Server,
Client,
Shared,
Unknown,
}Expand description
Where a script runs. This is the single most important fact about a file: a rule that fires in the wrong context is noise, and noise is how a security tool dies.
Variants§
Implementations§
Source§impl RunContext
impl RunContext
Sourcepub fn from_service(name: &str) -> Option<Self>
pub fn from_service(name: &str) -> Option<Self>
Resolve from the Roblox service a file lands in.
Sourcepub fn from_file_name(name: &str) -> Option<Self>
pub fn from_file_name(name: &str) -> Option<Self>
Resolve from a Rojo filename suffix: Foo.server.luau, Bar.client.luau.
Sourcepub fn resolve(relative: &Path, instance_path: &str) -> Self
pub fn resolve(relative: &Path, instance_path: &str) -> Self
Resolve a file. The filename suffix wins over the service because
ReplicatedStorage/Foo.client.luau is a client script in a shared container.
allow_path_guessing is false in the plain model: an explicit .server.luau or
.client.luau suffix still sets the context, but src/server and src/client
directory names do not. A Lune project is not a Roblox project just because a
folder is called server.
Trait Implementations§
Source§impl Clone for RunContext
impl Clone for RunContext
impl Copy for RunContext
Source§impl Debug for RunContext
impl Debug for RunContext
Source§impl<'de> Deserialize<'de> for RunContext
impl<'de> Deserialize<'de> for RunContext
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
impl Eq for RunContext
Source§impl Hash for RunContext
impl Hash for RunContext
Source§impl PartialEq for RunContext
impl PartialEq for RunContext
Source§impl Serialize for RunContext
impl Serialize for RunContext
impl StructuralPartialEq for RunContext
Auto Trait Implementations§
impl Forget for RunContext
impl Freeze for RunContext
impl Move for RunContext
impl RefUnwindSafe for RunContext
impl Send for RunContext
impl Sync for RunContext
impl Unpin for RunContext
impl UnsafeUnpin for RunContext
impl UnwindSafe for RunContext
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