pub struct TextSettings { /* private fields */ }Expand description
The settings as names and values, in name order (as the game writes them).
Implementations§
Source§impl TextSettings
impl TextSettings
Sourcepub fn parse(text: &str) -> TextSettings
pub fn parse(text: &str) -> TextSettings
Read name=value lines; other lines are ignored.
Sourcepub fn get_text(&self, section: &str, name: &str) -> Option<&str>
pub fn get_text(&self, section: &str, name: &str) -> Option<&str>
A text value, or None when absent or empty.
Sourcepub fn with_prefix<'a>(
&'a self,
prefix: &'a str,
) -> impl Iterator<Item = (&'a str, &'a str)>
pub fn with_prefix<'a>( &'a self, prefix: &'a str, ) -> impl Iterator<Item = (&'a str, &'a str)>
Every value whose name starts with prefix, as (rest of the name, value).
Sourcepub fn load(path: &Path) -> Result<TextSettings>
pub fn load(path: &Path) -> Result<TextSettings>
Read the file at path; an absent file is empty settings.
Trait Implementations§
Source§impl Clone for TextSettings
impl Clone for TextSettings
Source§fn clone(&self) -> TextSettings
fn clone(&self) -> TextSettings
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextSettings
impl Debug for TextSettings
Source§impl Default for TextSettings
impl Default for TextSettings
Source§fn default() -> TextSettings
fn default() -> TextSettings
Returns the “default value” for a type. Read more
impl Eq for TextSettings
Source§impl PartialEq for TextSettings
impl PartialEq for TextSettings
Source§impl Settings for TextSettings
impl Settings for TextSettings
impl StructuralPartialEq for TextSettings
Auto Trait Implementations§
impl Freeze for TextSettings
impl RefUnwindSafe for TextSettings
impl Send for TextSettings
impl Sync for TextSettings
impl Unpin for TextSettings
impl UnsafeUnpin for TextSettings
impl UnwindSafe for TextSettings
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