pub struct DirectorySetting {
pub meta: GameSettingMeta,
/* private fields */
}Expand description
A directory path entry from an openmw.cfg file (data=, config=, user-data=, etc.).
Stores both the original string exactly as it appeared in the file (for round-trip
serialisation) and a parsed PathBuf with quotes stripped, token substitution applied
(?local?, ?global?, ?userdata?, ?userconfig?), and the path resolved relative to the
config file’s directory.
Fields§
§meta: GameSettingMetaImplementations§
Source§impl DirectorySetting
impl DirectorySetting
Sourcepub fn new<S: Into<String>>(
value: S,
source_config: PathBuf,
comment: &mut String,
) -> Self
pub fn new<S: Into<String>>( value: S, source_config: PathBuf, comment: &mut String, ) -> Self
Parses value as a directory path relative to source_config.
Consumes the accumulated comment string (via std::mem::take) and stores it in the
setting’s metadata so comments are preserved through serialisation.
Sourcepub fn original(&self) -> &String
pub fn original(&self) -> &String
The raw string exactly as it appeared in the openmw.cfg file, including any quotes.
Use this when serialising back to openmw.cfg format to preserve the original style.
Sourcepub fn original_str(&self) -> &str
pub fn original_str(&self) -> &str
Borrowed string view of Self::original.
Trait Implementations§
Source§impl Clone for DirectorySetting
impl Clone for DirectorySetting
Source§impl Debug for DirectorySetting
impl Debug for DirectorySetting
Auto Trait Implementations§
impl Freeze for DirectorySetting
impl RefUnwindSafe for DirectorySetting
impl Send for DirectorySetting
impl Sync for DirectorySetting
impl Unpin for DirectorySetting
impl UnsafeUnpin for DirectorySetting
impl UnwindSafe for DirectorySetting
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more