pub struct InterfaceConfig {
pub interface: InterfaceInfo,
pub server: ServerInfo,
/* private fields */
}Expand description
This struct contains everything necessary to establish an innernet connection: information about a local innernet interface and a remote innernet server.
Fields§
§interface: InterfaceInfoThe information to bring up the interface.
server: ServerInfoThe necessary contact information for the server.
Implementations§
Source§impl InterfaceConfig
impl InterfaceConfig
Sourcepub fn save_new(
&self,
path: impl AsRef<Path>,
mode: u32,
) -> Result<(), WrappedIoError>
pub fn save_new( &self, path: impl AsRef<Path>, mode: u32, ) -> Result<(), WrappedIoError>
Save a new config file, failing if it already exists.
Sourcepub fn save(
&self,
config_dir: &Path,
interface: &InterfaceName,
) -> Result<PathBuf, Error>
pub fn save( &self, config_dir: &Path, interface: &InterfaceName, ) -> Result<PathBuf, Error>
Overwrites the config file if it already exists.
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn from_interface( config_dir: &Path, interface: &InterfaceName, ) -> Result<Self, Error>
pub fn get_path(config_dir: &Path, interface: &InterfaceName) -> PathBuf
pub fn build_config_file_path( config_dir: &Path, interface: &InterfaceName, ) -> Result<PathBuf, WrappedIoError>
pub fn peer_endpoint_overrides(&self) -> &BTreeMap<IpAddr, Endpoint>
pub fn set_endpoint_override_for_peer( &mut self, peer_ip: IpAddr, endpoint: Endpoint, )
pub fn unset_endpoint_override_for_peer(&mut self, peer_ip: IpAddr)
Trait Implementations§
Source§impl Clone for InterfaceConfig
impl Clone for InterfaceConfig
Source§fn clone(&self) -> InterfaceConfig
fn clone(&self) -> InterfaceConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InterfaceConfig
impl Debug for InterfaceConfig
Source§impl<'de> Deserialize<'de> for InterfaceConfig
impl<'de> Deserialize<'de> for InterfaceConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InterfaceConfig
impl RefUnwindSafe for InterfaceConfig
impl Send for InterfaceConfig
impl Sync for InterfaceConfig
impl Unpin for InterfaceConfig
impl UnsafeUnpin for InterfaceConfig
impl UnwindSafe for InterfaceConfig
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