Struct ini::ini::Ini [−][src]
pub struct Ini { /* fields omitted */ }
Ini struct
Methods
impl Ini
[src]
impl Ini
pub fn new() -> Ini
[src]
pub fn new() -> Ini
Create an instance
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>,
Set with a specified section, None
is for the general section
pub fn general_section(&self) -> &Properties
[src]
pub fn general_section(&self) -> &Properties
Get the immmutable general section
pub fn general_section_mut(&mut self) -> &mut Properties
[src]
pub fn general_section_mut(&mut self) -> &mut Properties
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>,
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>,
Get a mutable section
pub fn entry(
&mut self,
name: Option<String>
) -> Entry<Option<String>, Properties>
[src]
pub fn entry(
&mut self,
name: Option<String>
) -> Entry<Option<String>, Properties>
Get the entry
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clear all entries
pub fn sections(&self) -> Keys<Option<String>, Properties>
[src]
pub fn sections(&self) -> Keys<Option<String>, Properties>
Iterate with sections
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>,
Set key-value to a section
pub fn get_from<'a, S>(
&'a self,
section: Option<S>,
key: &str
) -> Option<&'a str> where
S: Into<String>,
[src]
pub fn get_from<'a, S>(
&'a self,
section: Option<S>,
key: &str
) -> Option<&'a str> where
S: Into<String>,
Get the value from a section 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<'a, S>(
&'a self,
section: Option<S>,
key: &str,
default: &'a str
) -> &'a str where
S: Into<String>,
[src]
pub fn get_from_or<'a, S>(
&'a self,
section: Option<S>,
key: &str,
default: &'a str
) -> &'a str where
S: Into<String>,
Get the value from a section 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<'a, S>(
&'a mut self,
section: Option<S>,
key: &str
) -> Option<&'a str> where
S: Into<String>,
[src]
pub fn get_from_mut<'a, S>(
&'a mut self,
section: Option<S>,
key: &str
) -> Option<&'a str> where
S: Into<String>,
Get the mutable from a section 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>,
Delete a section, return the properties if it exists
pub fn delete_from<S>(
&mut self,
section: Option<S>,
key: &str
) -> Option<String> where
S: Into<String>,
[src]
pub fn delete_from<S>(
&mut self,
section: Option<S>,
key: &str
) -> Option<String> where
S: Into<String>,
impl Ini
[src]
impl Ini
pub fn write_to_file<P: AsRef<Path>>(&self, filename: P) -> Result<()>
[src]
pub fn write_to_file<P: AsRef<Path>>(&self, filename: P) -> Result<()>
Write to a file
pub fn write_to_file_policy<P: AsRef<Path>>(
&self,
filename: P,
policy: EscapePolicy
) -> Result<()>
[src]
pub fn write_to_file_policy<P: AsRef<Path>>(
&self,
filename: P,
policy: EscapePolicy
) -> Result<()>
Write to a file
pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<()>
[src]
pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<()>
Write to a writer
pub fn write_to_policy<W: Write>(
&self,
writer: &mut W,
policy: EscapePolicy
) -> Result<()>
[src]
pub fn write_to_policy<W: Write>(
&self,
writer: &mut W,
policy: EscapePolicy
) -> Result<()>
Write to a writer
impl Ini
[src]
impl Ini
pub fn load_from_str(buf: &str) -> Result<Ini, ParseError>
[src]
pub fn load_from_str(buf: &str) -> Result<Ini, ParseError>
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>
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>
Load from a string with options
pub fn read_from<R: Read>(reader: &mut R) -> Result<Ini, Error>
[src]
pub fn read_from<R: Read>(reader: &mut R) -> Result<Ini, Error>
Load from a reader
pub fn read_from_noescape<R: Read>(reader: &mut R) -> Result<Ini, Error>
[src]
pub fn read_from_noescape<R: Read>(reader: &mut R) -> Result<Ini, Error>
Load from a reader, but do not interpret '' as an escape character
pub fn read_from_opt<R: Read>(
reader: &mut R,
opt: ParseOption
) -> Result<Ini, Error>
[src]
pub fn read_from_opt<R: Read>(
reader: &mut R,
opt: ParseOption
) -> Result<Ini, Error>
Load from a reader with options
pub fn load_from_file<P: AsRef<Path>>(filename: P) -> Result<Ini, Error>
[src]
pub fn load_from_file<P: AsRef<Path>>(filename: P) -> Result<Ini, Error>
Load from a file
pub fn load_from_file_noescape<P: AsRef<Path>>(
filename: P
) -> Result<Ini, Error>
[src]
pub fn load_from_file_noescape<P: AsRef<Path>>(
filename: P
) -> Result<Ini, Error>
Load from a file, but do not interpret '' as an escape character
pub fn load_from_file_opt<P: AsRef<Path>>(
filename: P,
opt: ParseOption
) -> Result<Ini, Error>
[src]
pub fn load_from_file_opt<P: AsRef<Path>>(
filename: P,
opt: ParseOption
) -> Result<Ini, Error>
Load from a file with options
impl<'a> Ini
[src]
impl<'a> Ini
ⓘImportant traits for SectionIterator<'a>pub fn iter(&'a self) -> SectionIterator<'a>
[src]
pub fn iter(&'a self) -> SectionIterator<'a>
Immutable iterate though sections
ⓘImportant traits for SectionMutIterator<'a>pub fn mut_iter(&'a mut self) -> SectionMutIterator<'a>
[src]
pub fn mut_iter(&'a mut self) -> SectionMutIterator<'a>
Mutable iterate though sections
Deprecated! Use iter_mut
instead!
ⓘImportant traits for SectionMutIterator<'a>pub fn iter_mut(&'a mut self) -> SectionMutIterator<'a>
[src]
pub fn iter_mut(&'a mut self) -> SectionMutIterator<'a>
Mutable iterate though sections
Trait Implementations
impl Clone for Ini
[src]
impl Clone for Ini
fn clone(&self) -> Ini
[src]
fn clone(&self) -> Ini
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Default for Ini
[src]
impl Default for Ini
impl<'q> Index<&'q Option<String>> for Ini
[src]
impl<'q> Index<&'q Option<String>> for Ini
type Output = Properties
The returned type after indexing.
fn index<'a>(&'a self, index: &'q Option<String>) -> &'a Properties
[src]
fn index<'a>(&'a self, index: &'q Option<String>) -> &'a Properties
Performs the indexing (container[index]
) operation.
impl<'i> IndexMut<&'i Option<String>> for Ini
[src]
impl<'i> IndexMut<&'i Option<String>> for Ini
fn index_mut<'a>(&'a mut self, index: &Option<String>) -> &'a mut Properties
[src]
fn index_mut<'a>(&'a mut self, index: &Option<String>) -> &'a mut Properties
Performs the mutable indexing (container[index]
) operation.
impl<'q> Index<&'q str> for Ini
[src]
impl<'q> Index<&'q str> for Ini
type Output = Properties
The returned type after indexing.
fn index<'a>(&'a self, index: &'q str) -> &'a Properties
[src]
fn index<'a>(&'a self, index: &'q str) -> &'a Properties
Performs the indexing (container[index]
) operation.
impl<'q> IndexMut<&'q str> for Ini
[src]
impl<'q> IndexMut<&'q str> for Ini
fn index_mut<'a>(&'a mut self, index: &'q str) -> &'a mut Properties
[src]
fn index_mut<'a>(&'a mut self, index: &'q str) -> &'a mut Properties
Performs the mutable indexing (container[index]
) operation.
impl<'a> IntoIterator for &'a Ini
[src]
impl<'a> IntoIterator for &'a Ini
type Item = (&'a Option<String>, &'a Properties)
The type of the elements being iterated over.
type IntoIter = SectionIterator<'a>
Which kind of iterator are we turning this into?
ⓘImportant traits for SectionIterator<'a>fn into_iter(self) -> SectionIterator<'a>
[src]
fn into_iter(self) -> SectionIterator<'a>
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a mut Ini
[src]
impl<'a> IntoIterator for &'a mut Ini
type Item = (&'a Option<String>, &'a mut Properties)
The type of the elements being iterated over.
type IntoIter = SectionMutIterator<'a>
Which kind of iterator are we turning this into?
ⓘImportant traits for SectionMutIterator<'a>fn into_iter(self) -> SectionMutIterator<'a>
[src]
fn into_iter(self) -> SectionMutIterator<'a>
Creates an iterator from a value. Read more
impl IntoIterator for Ini
[src]
impl IntoIterator for Ini
type Item = (Option<String>, Properties)
The type of the elements being iterated over.
type IntoIter = SectionIntoIter
Which kind of iterator are we turning this into?
ⓘImportant traits for SectionIntoIterfn into_iter(self) -> SectionIntoIter
[src]
fn into_iter(self) -> SectionIntoIter
Creates an iterator from a value. Read more