Struct dimas_config::Config
source · pub struct Config { /* private fields */ }Expand description
Manages the configuration
Implementations§
source§impl Config
impl Config
sourcepub fn local() -> Result<Self>
pub fn local() -> Result<Self>
Create a configuration based on file named local.json5.
Will search in the directories mentioned in Examples.
This file should contain a configuration that only connects to entities on same host.
§Errors
Returns a std::io::Error, if file does not exist in any of the places or is not accessible.
sourcepub fn client() -> Result<Self>
pub fn client() -> Result<Self>
Create a configuration based on file named client.json5.
Will search in the directories mentioned in Examples.
This file should contain a configuration that creates an entity in client mode.
§Errors
Returns a std::io::Error, if file does not exist in any of the places or is not accessible.
sourcepub fn peer() -> Result<Self>
pub fn peer() -> Result<Self>
Create a configuration based on file named peer.json5.
Will search in the directories mentioned in Examples.
This file should contain a configuration that creates an entity in peer mode.
§Errors
Returns a std::io::Error, if file does not exist in any of the places or is not accessible.
sourcepub fn router() -> Result<Self>
pub fn router() -> Result<Self>
Create a configuration based on file named router.json5.
Will search in the directories mentioned in Examples.
This file should contain a configuration that creates an entity in router mode.
§Errors
Returns a std::io::Error, if file does not exist in any of the places or is not accessible.
sourcepub fn from_file(filename: &str) -> Result<Self>
pub fn from_file(filename: &str) -> Result<Self>
Create a configuration based on file with given filename.
Will search in the directories mentioned in Examples.
§Errors
Returns a std::io::Error, if file does not exist in any of the places or is not accessible.
sourcepub fn zenoh_config(&self) -> Config
pub fn zenoh_config(&self) -> Config
Method to extract the zenoh configuration from Config.
Can be passed to zenoh::open().
Trait Implementations§
source§impl Default for Config
impl Default for Config
source§fn default() -> Self
fn default() -> Self
Create a default configuration
Will search for a configuration file with name “default.json5” in the directories mentioned in Examples.
This file should contain the wanted default configuration.
If no file is found, it will create a defined minimal default configuration.
Currently this is just a default zenoh peer configuration which connects to peers in same subnet.