Skip to main content

UnitStatus

Struct UnitStatus 

Source
pub struct UnitStatus {
Show 13 fields pub flags: UnitFlag, pub uptime: u32, pub boot_count: u32, pub reboot_count: u32, pub encoder_health: u32, pub decoder_health: u32, pub network: UnitNetConfig, pub fan_rpm: u16, pub fan_duty: u8, pub status: u8, pub net_revert_s: u8, pub temperatures: Vec<i8>, pub status_message: String,
}
Expand description

A unit’s health and IP configuration, as it last reported them.

A unit reports this about itself with its periodic broadcast, and within a few seconds of a change to its flags, its status or its addresses.

Fields§

§flags: UnitFlag

The report’s flags.

§uptime: u32

Seconds since the unit booted.

§boot_count: u32

How often the unit has booted, when flags has BOOT_COUNT.

§reboot_count: u32

How often the unit has rebooted.

§encoder_health: u32

The encoder’s health, a mask of the unit’s encoder status bits.

§decoder_health: u32

The decoder’s health, a mask of the unit’s decoder status and state bits.

§network: UnitNetConfig

The IP configuration in use.

§fan_rpm: u16

The fan speed in RPM, when flags has FAN_SPEED.

§fan_duty: u8

The fan duty cycle, in percent.

§status: u8

The unit’s system status.

§net_revert_s: u8

Seconds before a pending IP configuration is reverted.

§temperatures: Vec<i8>

Temperatures, in degrees Celsius, at most UNIT_MAX_TEMPERATURES of them.

§status_message: String

The message of the current system status.

Implementations§

Source§

impl UnitStatus

Source

pub const fn boot_count(&self) -> Option<u32>

How often the unit has booted, None while it does not report it.

Source

pub const fn fan_rpm(&self) -> Option<u16>

The fan speed in RPM, None while the unit does not report it.

Source

pub const fn network_pending(&self) -> bool

Whether an IP configuration changed through the mesh waits for the mesh controller to confirm it.

Trait Implementations§

Source§

impl Clone for UnitStatus

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 Debug for UnitStatus

Source§

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

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

impl Default for UnitStatus

Source§

fn default() -> Self

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

impl Eq for UnitStatus

Source§

impl PartialEq for UnitStatus

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 UnitStatus

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