pub struct IPRoute { /* private fields */ }Expand description
GLib type: Shared boxed type with reference counted clone semantics.
Implementations§
Source§impl IPRoute
impl IPRoute
Sourcepub fn new(
family: i32,
dest: &str,
prefix: u32,
next_hop: Option<&str>,
metric: i64,
) -> Result<IPRoute, Error>
pub fn new( family: i32, dest: &str, prefix: u32, next_hop: Option<&str>, metric: i64, ) -> Result<IPRoute, Error>
Creates a new #NMIPRoute object.
§family
the IP address family (
§dest
the IP address of the route’s destination
§prefix
the address prefix length
§next_hop
the IP address of the next hop (or None)
§metric
the route metric (or -1 for “default”)
§Returns
the new #NMIPRoute object, or None on error
Sourcepub fn equal_full(&self, other: &IPRoute, cmp_flags: u32) -> bool
Available on crate feature v1_10 only.
pub fn equal_full(&self, other: &IPRoute, cmp_flags: u32) -> bool
v1_10 only.Determines if two #NMIPRoute objects contain the same destination, prefix, next hop, and metric.
§other
the #NMIPRoute to compare @self to.
§cmp_flags
tune how to compare attributes. Currently, only NM_IP_ROUTE_EQUAL_CMP_FLAGS_NONE (0) and NM_IP_ROUTE_EQUAL_CMP_FLAGS_WITH_ATTRS (1) is supported.
§Returns
true if the objects contain the same values, false if they do not.
Sourcepub fn attribute_names(&self) -> Vec<GString>
pub fn attribute_names(&self) -> Vec<GString>
Sourcepub fn dest(&self) -> GString
pub fn dest(&self) -> GString
Gets the IP destination address property of this route object.
§Returns
the IP address of the route’s destination
Sourcepub fn family(&self) -> i32
pub fn family(&self) -> i32
Gets the IP address family (eg, AF_INET) property of this route object.
§Returns
the IP address family
Sourcepub fn metric(&self) -> i64
pub fn metric(&self) -> i64
Gets the route metric property of this route object; lower values indicate “better” or more preferred routes; -1 indicates “default” (meaning NetworkManager will set it appropriately).
§Returns
the route metric
Sourcepub fn set_dest(&self, dest: &str)
pub fn set_dest(&self, dest: &str)
Sets the destination property of this route object.
@dest must be a valid address of @self’s family. If you aren’t sure you have a valid address, use nm_inet_is_valid() to check it.
§dest
the route’s destination, as a string
Sourcepub fn set_metric(&self, metric: i64)
pub fn set_metric(&self, metric: i64)
Sourcepub fn set_next_hop(&self, next_hop: Option<&str>)
pub fn set_next_hop(&self, next_hop: Option<&str>)
Sourcepub fn set_prefix(&self, prefix: u32)
pub fn set_prefix(&self, prefix: u32)
Sourcepub fn variant_attribute_spec() -> VariantAttributeSpec
Available on crate feature v1_8 only.
pub fn variant_attribute_spec() -> VariantAttributeSpec
v1_8 only.§Returns
the specifiers for route attributes
Trait Implementations§
Source§impl HasParamSpec for IPRoute
impl HasParamSpec for IPRoute
Source§impl Ord for IPRoute
impl Ord for IPRoute
Source§impl PartialOrd for IPRoute
impl PartialOrd for IPRoute
Source§impl StaticType for IPRoute
impl StaticType for IPRoute
Source§fn static_type() -> Type
fn static_type() -> Type
Self.