IPRoutingRule

Struct IPRoutingRule 

Source
pub struct IPRoutingRule { /* private fields */ }
Expand description

GLib type: Shared boxed type with reference counted clone semantics.

Implementations§

Source§

impl IPRoutingRule

Source

pub fn as_ptr(&self) -> *mut NMIPRoutingRule

Return the inner pointer to the underlying C value.

Source

pub unsafe fn from_glib_ptr_borrow(ptr: &*mut NMIPRoutingRule) -> &Self

Borrows the underlying C value.

Source§

impl IPRoutingRule

Source

pub fn new(addr_family: i32) -> IPRoutingRule

Available on crate feature v1_18 only.
§addr_family

the address family of the routing rule. Must be either AF_INET (2) or AF_INET6 (10).

§Returns

a newly created rule instance with the provided address family. The instance is unsealed.

Source

pub fn cmp(&self, other: Option<&IPRoutingRule>) -> i32

Available on crate feature v1_18 only.
§other

the other #NMIPRoutingRule instance to compare

§Returns

zero, a positive, or a negative integer to indicate equality or how the arguments compare.

Source

pub fn action(&self) -> u8

Available on crate feature v1_18 only.
§Returns

the set action.

Source

pub fn addr_family(&self) -> i32

Available on crate feature v1_18 only.
§Returns

the address family of the rule. Either AF_INET or AF_INET6.

Source

pub fn destination_port_end(&self) -> u16

Available on crate feature v1_18 only.
§Returns

the destination port end setting.

Source

pub fn destination_port_start(&self) -> u16

Available on crate feature v1_18 only.
§Returns

the destination port start setting.

Source

pub fn from(&self) -> GString

Available on crate feature v1_18 only.
§Returns

the set from/src parameter or None, if no value is set.

Source

pub fn from_len(&self) -> u8

Available on crate feature v1_18 only.
§Returns

the set prefix length for the from/src parameter.

Source

pub fn fwmark(&self) -> u32

Available on crate feature v1_18 only.
§Returns

the fwmark setting.

Source

pub fn fwmask(&self) -> u32

Available on crate feature v1_18 only.
§Returns

the fwmask setting.

Source

pub fn iifname(&self) -> GString

Available on crate feature v1_18 only.
§Returns

the set iifname or None if unset.

Source

pub fn inverts(&self) -> bool

Available on crate feature v1_18 only.
§Returns

the “invert” setting of the rule.

Source

pub fn ipproto(&self) -> u8

Available on crate feature v1_18 only.
§Returns

the ipproto of the rule.

Source

pub fn oifname(&self) -> GString

Available on crate feature v1_18 only.
§Returns

the set oifname or None if unset.

Source

pub fn priority(&self) -> i64

Available on crate feature v1_18 only.
§Returns

the priority. A valid priority is in the range from 0 to G_MAXUINT32. If unset, -1 is returned.

Source

pub fn source_port_end(&self) -> u16

Available on crate feature v1_18 only.
§Returns

the source port end setting.

Source

pub fn source_port_start(&self) -> u16

Available on crate feature v1_18 only.
§Returns

the source port start setting.

Source

pub fn suppress_prefixlength(&self) -> i32

Available on crate feature v1_20 only.
§Returns

the suppress_prefixlength of the rule. -1 means that the value is unset.

Source

pub fn table(&self) -> u32

Available on crate feature v1_18 only.
§Returns

the set table.

Source

pub fn to(&self) -> GString

Available on crate feature v1_18 only.
§Returns

the set to/dst parameter or None, if no value is set.

Source

pub fn to_len(&self) -> u8

Available on crate feature v1_18 only.
§Returns

the set prefix length for the to/dst parameter.

Source

pub fn tos(&self) -> u8

Available on crate feature v1_18 only.
§Returns

the tos of the rule.

Source

pub fn is_sealed(&self) -> bool

Available on crate feature v1_18 only.
§Returns

whether @self is sealed. Once sealed, an instance cannot be modified nor unsealed.

Source

pub fn new_clone(&self) -> IPRoutingRule

Available on crate feature v1_18 only.

Since 1.42, ref-counting of #NMIPRoutingRule is thread-safe.

§Returns

a newly created rule instance with the same settings as @self. Note that the instance will always be unsealed.

Source

pub fn seal(&self)

Available on crate feature v1_18 only.

Seals the routing rule. Afterwards, the instance can no longer be modified, and it is a bug to call any of the accessors that would modify the rule. If @self was already sealed, this has no effect.

Source

pub fn set_action(&self, action: u8)

Available on crate feature v1_18 only.

Note that currently only certain actions are allowed. nm_ip_routing_rule_validate() will reject unsupported actions as invalid.

§action

the action to set

Source

pub fn set_destination_port(&self, start: u16, end: u16)

Available on crate feature v1_18 only.
§start

the start port to set.

§end

the end port to set.

Source

pub fn set_from(&self, from: Option<&str>)

Available on crate feature v1_18 only.

Setting invalid values is accepted, but will later fail during nm_ip_routing_rule_validate().

§from

the from/src address to set. The address family must match.

§len

the corresponding prefix length of the address.

Source

pub fn set_fwmark(&self, fwmark: u32, fwmask: u32)

Available on crate feature v1_18 only.
§fwmark

the fwmark

§fwmask

the fwmask

Source

pub fn set_iifname(&self, iifname: Option<&str>)

Available on crate feature v1_18 only.

The name supports C backslash escaping for non-UTF-8 characters. Note that nm_ip_routing_rule_from_string() too uses backslash escaping when tokenizing the words by whitespace. So, in string representation you’d get double backslashes.

§iifname

the iifname to set or None to unset.

Source

pub fn set_invert(&self, invert: bool)

Available on crate feature v1_18 only.
§invert

the new value to set

Source

pub fn set_ipproto(&self, ipproto: u8)

Available on crate feature v1_18 only.
§ipproto

the ipproto to set

Source

pub fn set_oifname(&self, oifname: Option<&str>)

Available on crate feature v1_18 only.

The name supports C backslash escaping for non-UTF-8 characters. Note that nm_ip_routing_rule_from_string() too uses backslash escaping when tokenizing the words by whitespace. So, in string representation you’d get double backslashes.

§oifname

the oifname to set or None to unset.

Source

pub fn set_priority(&self, priority: i64)

Available on crate feature v1_18 only.

A valid priority ranges from 0 to G_MAXUINT32. “-1” is also allowed to reset the priority. It is a bug calling this function with any other value.

§priority

the priority to set

Source

pub fn set_source_port(&self, start: u16, end: u16)

Available on crate feature v1_18 only.
§start

the start port to set.

§end

the end port to set.

Source

pub fn set_suppress_prefixlength(&self, suppress_prefixlength: i32)

Available on crate feature v1_20 only.
§suppress_prefixlength

the suppress_prefixlength to set. The value -1 means unset.

Source

pub fn set_table(&self, table: u32)

Available on crate feature v1_18 only.
§table

the table to set

Source

pub fn set_to(&self, to: Option<&str>)

Available on crate feature v1_18 only.

Setting invalid values is accepted, but will later fail during nm_ip_routing_rule_validate().

§to

the to/dst address to set. The address family must match.

§len

the corresponding prefix length of the address. If @to is None, this valid is ignored.

Source

pub fn set_tos(&self, tos: u8)

Available on crate feature v1_18 only.
§tos

the tos to set

Source

pub fn validate(&self) -> Result<(), Error>

Available on crate feature v1_18 only.
§Returns

true if the rule validates.

Trait Implementations§

Source§

impl Clone for IPRoutingRule

Source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the reference. Dropping the reference will decrement it again.

1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IPRoutingRule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<IPRoutingRule> for Value

Source§

fn from(s: IPRoutingRule) -> Self

Converts to this type from the input type.
Source§

impl HasParamSpec for IPRoutingRule

Source§

type ParamSpec = ParamSpecBoxed

Source§

type SetValue = IPRoutingRule

Preferred value to be used as setter for the associated ParamSpec.
Source§

type BuilderFn = fn(&str) -> ParamSpecBoxedBuilder<'_, IPRoutingRule>

Source§

fn param_spec_builder() -> Self::BuilderFn

Source§

impl Hash for IPRoutingRule

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for IPRoutingRule

Source§

fn cmp(&self, other: &IPRoutingRule) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for IPRoutingRule

Source§

fn eq(&self, other: &IPRoutingRule) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for IPRoutingRule

Source§

fn partial_cmp(&self, other: &IPRoutingRule) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StaticType for IPRoutingRule

Source§

fn static_type() -> Type

Returns the type identifier of Self.
Source§

impl Eq for IPRoutingRule

Source§

impl StructuralPartialEq for IPRoutingRule

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

Source§

impl<T> Property for T
where T: HasParamSpec,

Source§

type Value = T

Source§

impl<T> PropertyGet for T
where T: HasParamSpec,

Source§

type Value = T

Source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

Source§

impl<T> StaticTypeExt for T
where T: StaticType,

Source§

fn ensure_type()

Ensures that the type has been registered with the type system.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TransparentType for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,