pub struct Scripts {
pub scripts: Vec<Script>,
/* private fields */
}Expand description
Project scripts.
Fields§
§scripts: Vec<Script>Implementations§
Source§impl Scripts
impl Scripts
pub fn new() -> Self
Sourcepub fn get(&self, rid: &ResourceId) -> Option<&Script>
pub fn get(&self, rid: &ResourceId) -> Option<&Script>
Gets a Script by its ResourceId if it is registered,
otherwise returns None.
Sourcepub fn contains(&self, rid: &ResourceId) -> bool
pub fn contains(&self, rid: &ResourceId) -> bool
Returns whether a script with the given id is registered.
Sourcepub fn contains_path(&self, path: &ResourcePath) -> bool
pub fn contains_path(&self, path: &ResourcePath) -> bool
Returns whether a script with the given path is registered.
Sourcepub fn by_path(&self, path: &ResourcePath) -> Option<&Script>
pub fn by_path(&self, path: &ResourcePath) -> Option<&Script>
Gets a script by its path if it is registered.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scripts
impl<'de> Deserialize<'de> for Scripts
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
Source§impl ListSetting for Scripts
impl ListSetting for Scripts
Source§impl LocalSettings for Scripts
impl LocalSettings for Scripts
Source§fn rel_path() -> SettingsResult<PathBuf>
fn rel_path() -> SettingsResult<PathBuf>
Returns the relative path to the settings file.
Source§fn base_path(&self) -> SettingsResult<PathBuf>
fn base_path(&self) -> SettingsResult<PathBuf>
Returns the base path for the settings.
Source§fn set_base_path(&mut self, path: PathBuf) -> SettingsResult
fn set_base_path(&mut self, path: PathBuf) -> SettingsResult
Sets the base path for the settings.
Source§impl LockSettingsFile for Scripts
impl LockSettingsFile for Scripts
Source§impl Settings for Scripts
impl Settings for Scripts
Source§fn store_lock(&mut self, lock: FlockLock<File>)
fn store_lock(&mut self, lock: FlockLock<File>)
Store the file lock of the settings file to prevent outside changes.
Source§fn controls_file(&self) -> bool
fn controls_file(&self) -> bool
Returns whether the current object controls the settings file or not.
Source§fn priority(&self) -> SettingsPriority
fn priority(&self) -> SettingsPriority
Returns the priority of the settings object.
Auto Trait Implementations§
impl Freeze for Scripts
impl RefUnwindSafe for Scripts
impl Send for Scripts
impl Sync for Scripts
impl Unpin for Scripts
impl UnwindSafe for Scripts
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