Struct rust_uci::Uci [−][src]
pub struct Uci(_);
Expand description
Contains the native uci_context
Implementations
impl Uci[src]
impl Uci[src]pub fn new() -> Result<Uci>[src]
pub fn new() -> Result<Uci>[src]Creates a new UCI context. The C memory will be freed when the object is dropped.
pub fn set_config_dir(&mut self, config_dir: &str) -> Result<()>[src]
pub fn set_config_dir(&mut self, config_dir: &str) -> Result<()>[src]Sets the config directory of UCI, this is /etc/config by default.
pub fn set_save_dir(&mut self, save_dir: &str) -> Result<()>[src]
pub fn set_save_dir(&mut self, save_dir: &str) -> Result<()>[src]Sets the save directory of UCI, this is /tmp/.uci by default.
pub fn delete(&mut self, identifier: &str) -> Result<()>[src]
pub fn delete(&mut self, identifier: &str) -> Result<()>[src]Delete an option or section in UCI.
UCI will keep the delta changes in a temporary location until commit() or revert() is called.
Allowed keys are like network.wan.proto, network.@interface[-1].iface, network.wan and network.@interface[-1]
if the deletion failed an Err is returned.
pub fn revert(&mut self, identifier: &str) -> Result<()>[src]
pub fn revert(&mut self, identifier: &str) -> Result<()>[src]Revert changes to an option, section or package
Allowed keys are like network, network.wan.proto, network.@interface[-1].iface, network.wan and network.@interface[-1]
if the deletion failed an Err is returned.
pub fn set(&mut self, identifier: &str, val: &str) -> Result<()>[src]
pub fn set(&mut self, identifier: &str, val: &str) -> Result<()>[src]Sets an option value or section type in UCI, creates the key if necessary.
UCI will keep the delta changes in a temporary location until commit() or revert() is called.
Allowed keys are like network.wan.proto, network.@interface[-1].iface, network.wan and network.@interface[-1]
if the assignment failed an Err is returned.
pub fn commit(&mut self, package: &str) -> Result<()>[src]
pub fn commit(&mut self, package: &str) -> Result<()>[src]Commit all changes to the specified package writing the temporary delta to the config file
pub fn get(&mut self, key: &str) -> Result<String>[src]
pub fn get(&mut self, key: &str) -> Result<String>[src]Queries an option value or section type from UCI. If a key has been changed in the delta, the updated value will be returned.
Allowed keys are like network.wan.proto, network.@interface[-1].iface, network.lan and network.@interface[-1]
if the entry does not exist an Err is returned.