Struct openmw_cfg::Ini [−][src]
pub struct Ini { /* fields omitted */ }
Expand description
Ini struct
Implementations
impl Ini
[src]
impl Ini
[src]pub fn with_section<S>(&mut self, section: Option<S>) -> SectionSetter<'_> where
S: Into<String>,
[src]
pub fn with_section<S>(&mut self, section: Option<S>) -> SectionSetter<'_> where
S: Into<String>,
[src]Set with a specified section, None
is for the general section
pub fn with_general_section(&mut self) -> SectionSetter<'_>
[src]
pub fn with_general_section(&mut self) -> SectionSetter<'_>
[src]Set with general section, a simple wrapper of with_section(None::<String>)
pub fn general_section(&self) -> &Properties
[src]
pub fn general_section(&self) -> &Properties
[src]Get the immmutable general section
pub fn general_section_mut(&mut self) -> &mut Properties
[src]
pub fn general_section_mut(&mut self) -> &mut Properties
[src]Get the mutable general section
pub fn section<S>(&self, name: Option<S>) -> Option<&Properties> where
S: Into<String>,
[src]
pub fn section<S>(&self, name: Option<S>) -> Option<&Properties> where
S: Into<String>,
[src]Get a immutable section
pub fn section_mut<S>(&mut self, name: Option<S>) -> Option<&mut Properties> where
S: Into<String>,
[src]
pub fn section_mut<S>(&mut self, name: Option<S>) -> Option<&mut Properties> where
S: Into<String>,
[src]Get a mutable section
pub fn section_all<S>(
&self,
name: Option<S>
) -> impl Iterator<Item = &Properties> where
S: Into<String>,
[src]
pub fn section_all<S>(
&self,
name: Option<S>
) -> impl Iterator<Item = &Properties> where
S: Into<String>,
[src]Get all sections immutable with the same key
pub fn section_all_mut<S>(
&mut self,
name: Option<S>
) -> impl Iterator<Item = &mut Properties> where
S: Into<String>,
[src]
pub fn section_all_mut<S>(
&mut self,
name: Option<S>
) -> impl Iterator<Item = &mut Properties> where
S: Into<String>,
[src]Get all sections mutable with the same key
pub fn entry(&mut self, name: Option<String>) -> SectionEntry<'_>
[src]
pub fn entry(&mut self, name: Option<String>) -> SectionEntry<'_>
[src]Get the entry
pub fn set_to<S>(&mut self, section: Option<S>, key: String, value: String) where
S: Into<String>,
[src]
pub fn set_to<S>(&mut self, section: Option<S>, key: String, value: String) where
S: Into<String>,
[src]Set key-value to a section
pub fn get_from<S>(&'a self, section: Option<S>, key: &str) -> Option<&'a str> where
S: Into<String>,
[src]
pub fn get_from<S>(&'a self, section: Option<S>, key: &str) -> Option<&'a str> where
S: Into<String>,
[src]Get the first value from the sections with key
Example:
use ini::Ini; let input = "[sec]\nabc = def\n"; let ini = Ini::load_from_str(input).unwrap(); assert_eq!(ini.get_from(Some("sec"), "abc"), Some("def"));
pub fn get_from_or<S>(
&'a self,
section: Option<S>,
key: &str,
default: &'a str
) -> &'a str where
S: Into<String>,
[src]
pub fn get_from_or<S>(
&'a self,
section: Option<S>,
key: &str,
default: &'a str
) -> &'a str where
S: Into<String>,
[src]Get the first value from the sections with key, return the default value if it does not exist
Example:
use ini::Ini; let input = "[sec]\n"; let ini = Ini::load_from_str(input).unwrap(); assert_eq!(ini.get_from_or(Some("sec"), "key", "default"), "default");
pub fn get_from_mut<S>(
&'a mut self,
section: Option<S>,
key: &str
) -> Option<&'a mut str> where
S: Into<String>,
[src]
pub fn get_from_mut<S>(
&'a mut self,
section: Option<S>,
key: &str
) -> Option<&'a mut str> where
S: Into<String>,
[src]Get the first mutable value from the sections with key
pub fn delete<S>(&mut self, section: Option<S>) -> Option<Properties> where
S: Into<String>,
[src]
pub fn delete<S>(&mut self, section: Option<S>) -> Option<Properties> where
S: Into<String>,
[src]Delete the first section with key, return the properties if it exists
impl Ini
[src]
impl Ini
[src]pub fn write_to_file<P>(&self, filename: P) -> Result<(), Error> where
P: AsRef<Path>,
[src]
pub fn write_to_file<P>(&self, filename: P) -> Result<(), Error> where
P: AsRef<Path>,
[src]Write to a file
pub fn write_to_file_policy<P>(
&self,
filename: P,
policy: EscapePolicy
) -> Result<(), Error> where
P: AsRef<Path>,
[src]
pub fn write_to_file_policy<P>(
&self,
filename: P,
policy: EscapePolicy
) -> Result<(), Error> where
P: AsRef<Path>,
[src]Write to a file
pub fn write_to_file_opt<P>(
&self,
filename: P,
opt: WriteOption
) -> Result<(), Error> where
P: AsRef<Path>,
[src]
pub fn write_to_file_opt<P>(
&self,
filename: P,
opt: WriteOption
) -> Result<(), Error> where
P: AsRef<Path>,
[src]Write to a file with options
pub fn write_to<W>(&self, writer: &mut W) -> Result<(), Error> where
W: Write,
[src]
pub fn write_to<W>(&self, writer: &mut W) -> Result<(), Error> where
W: Write,
[src]Write to a writer
pub fn write_to_policy<W>(
&self,
writer: &mut W,
policy: EscapePolicy
) -> Result<(), Error> where
W: Write,
[src]
pub fn write_to_policy<W>(
&self,
writer: &mut W,
policy: EscapePolicy
) -> Result<(), Error> where
W: Write,
[src]Write to a writer
pub fn write_to_opt<W>(
&self,
writer: &mut W,
opt: WriteOption
) -> Result<(), Error> where
W: Write,
[src]
pub fn write_to_opt<W>(
&self,
writer: &mut W,
opt: WriteOption
) -> Result<(), Error> where
W: Write,
[src]Write to a writer with options
impl Ini
[src]
impl Ini
[src]pub fn load_from_str(buf: &str) -> Result<Ini, ParseError>
[src]
pub fn load_from_str(buf: &str) -> Result<Ini, ParseError>
[src]Load from a string
pub fn load_from_str_noescape(buf: &str) -> Result<Ini, ParseError>
[src]
pub fn load_from_str_noescape(buf: &str) -> Result<Ini, ParseError>
[src]Load from a string, but do not interpret ’' as an escape character
pub fn load_from_str_opt(buf: &str, opt: ParseOption) -> Result<Ini, ParseError>
[src]
pub fn load_from_str_opt(buf: &str, opt: ParseOption) -> Result<Ini, ParseError>
[src]Load from a string with options
pub fn read_from_noescape<R>(reader: &mut R) -> Result<Ini, Error> where
R: Read,
[src]
pub fn read_from_noescape<R>(reader: &mut R) -> Result<Ini, Error> where
R: Read,
[src]Load from a reader, but do not interpret ’' as an escape character
pub fn read_from_opt<R>(reader: &mut R, opt: ParseOption) -> Result<Ini, Error> where
R: Read,
[src]
pub fn read_from_opt<R>(reader: &mut R, opt: ParseOption) -> Result<Ini, Error> where
R: Read,
[src]Load from a reader with options
pub fn load_from_file<P>(filename: P) -> Result<Ini, Error> where
P: AsRef<Path>,
[src]
pub fn load_from_file<P>(filename: P) -> Result<Ini, Error> where
P: AsRef<Path>,
[src]Load from a file
pub fn load_from_file_noescape<P>(filename: P) -> Result<Ini, Error> where
P: AsRef<Path>,
[src]
pub fn load_from_file_noescape<P>(filename: P) -> Result<Ini, Error> where
P: AsRef<Path>,
[src]Load from a file, but do not interpret ’' as an escape character
pub fn load_from_file_opt<P>(
filename: P,
opt: ParseOption
) -> Result<Ini, Error> where
P: AsRef<Path>,
[src]
pub fn load_from_file_opt<P>(
filename: P,
opt: ParseOption
) -> Result<Ini, Error> where
P: AsRef<Path>,
[src]Load from a file with options
impl<'a> Ini
[src]
impl<'a> Ini
[src]pub fn iter(&'a self) -> SectionIter<'a>
[src]
pub fn iter(&'a self) -> SectionIter<'a>
[src]Immutable iterate though sections
pub fn mut_iter(&'a mut self) -> SectionIterMut<'a>
[src]
pub fn mut_iter(&'a mut self) -> SectionIterMut<'a>
[src]Mutable iterate though sections
Deprecated! Use iter_mut
instead!
pub fn iter_mut(&'a mut self) -> SectionIterMut<'a>
[src]
pub fn iter_mut(&'a mut self) -> SectionIterMut<'a>
[src]Mutable iterate though sections
Trait Implementations
impl<'q> Index<&'q str> for Ini
[src]
impl<'q> Index<&'q str> for Ini
[src]type Output = Properties
type Output = Properties
The returned type after indexing.
pub fn index(&'a self, index: &'q str) -> &'a Properties
[src]
pub fn index(&'a self, index: &'q str) -> &'a Properties
[src]Performs the indexing (container[index]
) operation. Read more
impl<S> Index<Option<S>> for Ini where
S: Into<String>,
[src]
impl<S> Index<Option<S>> for Ini where
S: Into<String>,
[src]type Output = Properties
type Output = Properties
The returned type after indexing.
pub fn index(&self, index: Option<S>) -> &Properties
[src]
pub fn index(&self, index: Option<S>) -> &Properties
[src]Performs the indexing (container[index]
) operation. Read more
impl<'q> IndexMut<&'q str> for Ini
[src]
impl<'q> IndexMut<&'q str> for Ini
[src]pub fn index_mut(&'a mut self, index: &'q str) -> &'a mut Properties
[src]
pub fn index_mut(&'a mut self, index: &'q str) -> &'a mut Properties
[src]Performs the mutable indexing (container[index]
) operation. Read more
impl<S> IndexMut<Option<S>> for Ini where
S: Into<String>,
[src]
impl<S> IndexMut<Option<S>> for Ini where
S: Into<String>,
[src]pub fn index_mut(&mut self, index: Option<S>) -> &mut Properties
[src]
pub fn index_mut(&mut self, index: Option<S>) -> &mut Properties
[src]Performs the mutable indexing (container[index]
) operation. Read more
impl<'a> IntoIterator for &'a Ini
[src]
impl<'a> IntoIterator for &'a Ini
[src]type IntoIter = SectionIter<'a>
type IntoIter = SectionIter<'a>
Which kind of iterator are we turning this into?
impl<'a> IntoIterator for &'a mut Ini
[src]
impl<'a> IntoIterator for &'a mut Ini
[src]type IntoIter = SectionIterMut<'a>
type IntoIter = SectionIterMut<'a>
Which kind of iterator are we turning this into?
Auto Trait Implementations
impl RefUnwindSafe for Ini
impl Send for Ini
impl Sync for Ini
impl Unpin for Ini
impl UnwindSafe for Ini
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,