Struct ndisapi_rs::IfLuid

source ·
#[repr(transparent)]
pub struct IfLuid(_);
Expand description

Wrapper for the NET_LUID_LH struct from the windows crate.

This struct provides a convenient, idiomatic interface for working with network interface Locally Unique Identifiers (LUIDs) in Rust, including implementations of important traits like PartialEq, Eq, PartialOrd, Ord, Debug, and Display.

Implementations§

source§

impl IfLuid

source

pub fn new(net_luid_lh: &NET_LUID_LH) -> Self

Constructs a new IfLuid instance from a reference to a NET_LUID_LH.

Arguments
  • net_luid_lh - A reference to a NET_LUID_LH value representing the network interface’s LUID.

Trait Implementations§

source§

impl Clone for IfLuid

source§

fn clone(&self) -> IfLuid

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for IfLuid

Implementation of Debug for IfLuid.

The debug representation displays the struct name and the Value field of the inner NET_LUID_LH union.

source§

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

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

impl Display for IfLuid

Implementation of Display for IfLuid.

The display representation shows the struct name followed by the Value field of the inner NET_LUID_LH union, enclosed in parentheses.

source§

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

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

impl From<IfLuid> for NET_LUID_LH

Implement the Into trait for converting an IfLuid value back into a NET_LUID_LH value.

source§

fn from(val: IfLuid) -> Self

Converts an IfLuid value back into a NET_LUID_LH value.

Arguments
  • self: An IfLuid value to be converted back into a NET_LUID_LH value.
Returns
  • NET_LUID_LH: The NET_LUID_LH value represented by the given IfLuid value.
source§

impl From<NET_LUID_LH> for IfLuid

Implement the From trait for converting a NET_LUID_LH value into an IfLuid value.

source§

fn from(luid: NET_LUID_LH) -> Self

Converts a NET_LUID_LH value into an IfLuid value.

Arguments
  • luid: A NET_LUID_LH value to be converted into IfLuid.
Returns
  • IfLuid: The IfLuid value representing the given NET_LUID_LH value.
source§

impl From<u64> for IfLuid

Implements the conversion from a u64 value to an IfLuid instance.

source§

fn from(value: u64) -> Self

Converts a u64 value into an IfLuid instance by creating a new NET_LUID_LH structure and setting its Value field to the input value.

Arguments
  • value - The u64 value that should be used to set the Value field of the NET_LUID_LH structure.
Returns
  • An IfLuid instance wrapping the created NET_LUID_LH structure.
Examples
use ndisapi_rs::IfLuid;
// Create two IfLuid instances using u64 values
let value1: u64 = 42;
let if_luid1 = IfLuid::from(value1);

let value2: u64 = 43;
let if_luid2 = IfLuid::from(value2);

let value3: u64 = 42;
let if_luid3 = IfLuid::from(value3);
//Compare the two IfLuid instances based on their inner NET_LUID_LH values
assert_ne!(if_luid1, if_luid2);
assert_eq!(if_luid1, if_luid3);
source§

impl Ord for IfLuid

Implementation of Ord for IfLuid.

This implementation provides a total ordering for IfLuid instances based on their Value fields.

source§

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

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

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

impl PartialEq<IfLuid> for IfLuid

Implementation of PartialEq for IfLuid.

Two IfLuid instances are considered equal if their Value fields are equal.

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<IfLuid> for IfLuid

Implementation of PartialOrd for IfLuid.

IfLuid instances are ordered based on their Value fields.

source§

fn partial_cmp(&self, other: &Self) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for IfLuid

source§

impl Eq for IfLuid

Implementation of Eq for IfLuid.

This is a marker trait that signals that IfLuid fulfills the properties of an equivalence relation for its PartialEq implementation.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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.