pub struct ConfigBlock { /* private fields */ }
Expand description
Represents a block in the config file or the document root
Implementations§
Source§impl ConfigBlock
impl ConfigBlock
pub fn new( name: String, params: Vec<String>, inner: Vec<ConfigBlock>, ) -> ConfigBlock
Sourcepub fn add_block(&mut self, block: ConfigBlock)
pub fn add_block(&mut self, block: ConfigBlock)
Adds a new sub block. This probably isn’t very useful for you
Sourcepub fn matching<'a>(&'a self, name: &'a str) -> ConfigIter<'a> ⓘ
pub fn matching<'a>(&'a self, name: &'a str) -> ConfigIter<'a> ⓘ
Returns an iterator of all inner config options with the specified name
Sourcepub fn inner<'a>(&'a self) -> &'a Vec<ConfigBlock>
pub fn inner<'a>(&'a self) -> &'a Vec<ConfigBlock>
Returns all inner config options
Sourcepub fn get(&self, i: usize) -> &str
pub fn get(&self, i: usize) -> &str
Returns a parameter. Panics if the parameter index is too high
Sourcepub fn get_opt(&self, i: usize) -> Option<&str>
pub fn get_opt(&self, i: usize) -> Option<&str>
Returns a parameter. Returns None if the index is too high
pub fn path<'a>(&'a self, keys: Vec<&'a str>) -> Option<&str>
Trait Implementations§
Source§impl Debug for ConfigBlock
impl Debug for ConfigBlock
Source§impl PartialEq for ConfigBlock
impl PartialEq for ConfigBlock
impl Eq for ConfigBlock
impl StructuralPartialEq for ConfigBlock
Auto Trait Implementations§
impl Freeze for ConfigBlock
impl RefUnwindSafe for ConfigBlock
impl Send for ConfigBlock
impl Sync for ConfigBlock
impl Unpin for ConfigBlock
impl UnwindSafe for ConfigBlock
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