pub struct Config { /* private fields */ }Expand description
Manages the configuration
Implementations§
Source§impl Config
impl Config
Sourcepub fn local() -> Result<Self, Box<dyn Error + Send + Sync + 'static>>
pub fn local() -> Result<Self, Box<dyn Error + Send + Sync + 'static>>
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, Box<dyn Error + Send + Sync + 'static>>
pub fn client() -> Result<Self, Box<dyn Error + Send + Sync + 'static>>
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, Box<dyn Error + Send + Sync + 'static>>
pub fn peer() -> Result<Self, Box<dyn Error + Send + Sync + 'static>>
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, Box<dyn Error + Send + Sync + 'static>>
pub fn router() -> Result<Self, Box<dyn Error + Send + Sync + 'static>>
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, Box<dyn Error + Send + Sync + 'static>>
pub fn from_file( filename: &str, ) -> Result<Self, Box<dyn Error + Send + Sync + 'static>>
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 const fn zenoh_config(&self) -> &Config
pub const 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§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