Skip to main content

AuditOperationFlags

Struct AuditOperationFlags 

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

BACnetAuditOperationFlags — a bit string selecting audit operations (Clause 21).

Bit positions 0 through 15 have the same meanings as the named AuditOperation values. Positions 16 through 31 are currently undefined and reserved for ASHRAE, so they must remain zero. Positions 32 through 63 are retained for proprietary operations.

Implementations§

Source§

impl AuditOperationFlags

Source

pub const fn empty() -> Self

An empty set of audit operations.

Source

pub fn from_bits(bits: u64) -> Result<Self>

Construct from the bit-position-preserving representation.

Currently undefined ASHRAE-reserved positions 16 through 31 are rejected rather than masked.

Source

pub const fn bits(self) -> u64

Return the complete bit-position-preserving representation.

Source

pub const fn is_empty(self) -> bool

Whether no audit operation bit is set.

Source

pub const fn contains(self, operation: AuditOperation) -> bool

Whether operation is selected.

Raw AuditOperation values above 63 are outside the production’s representable range and therefore return false.

Source

pub fn insert(&mut self, operation: AuditOperation) -> bool

Select operation, returning false without mutation when its raw value is outside the representable range 0 through 63.

Source

pub fn remove(&mut self, operation: AuditOperation) -> bool

Clear operation, returning false when its raw value is outside the representable range 0 through 63.

Source

pub fn iter(self) -> impl Iterator<Item = AuditOperation>

Iterate selected operations in ascending bit-position order, including proprietary raw values.

Source

pub fn from_bacnet(unused_bits: u8, data: &[u8]) -> Result<Self>

Decode a Clause 20.2.10 BIT STRING payload.

data excludes the initial unused-bits octet. The decoder rejects values wider than the 64 positions allowed by BACnetAuditOperationFlags, invalid unused-bit counts, and nonzero padding in the final octet.

Source

pub fn to_bacnet(self) -> (u8, Vec<u8>)

Encode as a shortest-form Clause 20.2.10 BIT STRING payload.

The returned data excludes the initial unused-bits octet. Bit 0 is placed in the most-significant position of the first data octet.

Trait Implementations§

Source§

impl Clone for AuditOperationFlags

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for AuditOperationFlags

Source§

impl Debug for AuditOperationFlags

Source§

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

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

impl Default for AuditOperationFlags

Source§

fn default() -> Self

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

impl Display for AuditOperationFlags

Source§

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

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

impl Eq for AuditOperationFlags

Source§

impl Hash for AuditOperationFlags

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 PartialEq for AuditOperationFlags

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AuditOperationFlags

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

Source§

fn to_string(&self) -> String

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

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
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.