#[repr(transparent)]
pub struct ChecksumFlags(_);
Expand description

Wrapper helper struct around u64.

The type uses transparent representation to enforce using the provided methods to set the values of the flags used by WinDivertHelperCalcChecksums()

The different flag values are:

  • no_ip: Do not calculate the IPv4 checksum.
  • no_icmp: Do not calculate the ICMP checksum.
  • no_icmpv6: Do not calculate the ICMPv6 checksum.
  • no_tcp: Do not calculate the TCP checksum.
  • no_udp: Do not calculate the UDP checksum.

Implementations§

source§

impl ChecksumFlags

source

pub const fn new() -> Self

Creates a new flag field with default zero value.

source

pub const fn set_no_ip(self) -> Self

Sets no_ip flag

source

pub const fn unset_no_ip(self) -> Self

Unsets no_ip flag

source

pub fn set_no_ip_value(&mut self, value: bool)

Sets no_ip flag to value.

source

pub const fn set_no_icmp(self) -> Self

Sets no_icmp flag

source

pub const fn unset_no_icmp(self) -> Self

Unsets no_icmp flag

source

pub fn set_no_icmp_value(&mut self, value: bool)

Sets no_icmp flag to value.

source

pub const fn set_no_icmpv6(self) -> Self

Sets no_icmpv6 flag

source

pub const fn unset_no_icmpv6(self) -> Self

Unsets no_icmpv6 flag

source

pub fn set_no_icmpv6_value(&mut self, value: bool)

Sets no_icmpv6 flag to value.

source

pub const fn set_no_tcp(self) -> Self

Sets no_tcp flag

source

pub const fn unset_no_tcp(self) -> Self

Unsets no_tcp flag

source

pub fn set_no_tcp_value(&mut self, value: bool)

Sets no_tcp flag to value.

source

pub const fn set_no_udp(self) -> Self

Sets no_udp flag

source

pub const fn unset_no_udp(self) -> Self

Unsets no_udp flag

source

pub fn set_no_udp_value(&mut self, value: bool)

Sets no_udp flag to value.

Trait Implementations§

source§

impl Clone for ChecksumFlags

source§

fn clone(&self) -> ChecksumFlags

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 ChecksumFlags

source§

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

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

impl Default for ChecksumFlags

source§

fn default() -> ChecksumFlags

Returns the “default value” for a type. Read more
source§

impl From<ChecksumFlags> for u64

source§

fn from(flags: ChecksumFlags) -> Self

Converts to this type from the input type.
source§

impl Copy for ChecksumFlags

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, 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.