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.
source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more