Energy

Struct Energy 

Source
pub struct Energy {
    pub voltage: u32,
    pub current: u32,
    pub real_power: u32,
    pub power_factor: i32,
    pub energy: u32,
    pub errors: u32,
}
Expand description

Energy Consumption - Format (0,3000)

Power consumption and energy metrics

§XDR Definition (sFlow Discussion)

/* Energy consumption */
/* opaque = counter_data; enterprise = 0; format = 3000 */

struct energy {
    unsigned int voltage;      /* measured in mV
                                  unknown = 4,294,976,295 */
    unsigned int current;      /* measured in mA
                                  unknown = 4,294,976,295 */
    unsigned int real_power;   /* measured in mW
                                  unknown = 4,294,976,295 */
    int power_factor;          /* power factor
                                  (expressed in 100ths of a
                                  percent)
                                  -10000 to 10000 for AC power
                                  -2,147,483,647 for unknown AC
                                  power factor
                                  2,147,483,647 for DC power */
    unsigned int energy;       /* energy in millijoules
                                  unknown = 4,294,976,295 */
    unsigned int errors;       /* count of power exceptions,
                                  including:
                                  over/under voltage
                                  over current
                                  over power
                                  unknown = 4,294,976,295 */
}

Fields§

§voltage: u32

Voltage measured in millivolts (unknown = 4,294,976,295)

§current: u32

Current measured in milliamps (unknown = 4,294,976,295)

§real_power: u32

Real power measured in milliwatts (unknown = 4,294,976,295)

§power_factor: i32

Power factor expressed in 100ths of a percent

  • Range: -10000 to 10000 for AC power
  • -2,147,483,647 for unknown AC power factor
  • 2,147,483,647 for DC power
§energy: u32

Energy in millijoules (unknown = 4,294,976,295)

§errors: u32

Count of power exceptions (over/under voltage, over current, over power) (unknown = 4,294,976,295)

Trait Implementations§

Source§

impl Clone for Energy

Source§

fn clone(&self) -> Energy

Returns a duplicate 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 Energy

Source§

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

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

impl PartialEq for Energy

Source§

fn eq(&self, other: &Energy) -> 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 Eq for Energy

Source§

impl StructuralPartialEq for Energy

Auto Trait Implementations§

§

impl Freeze for Energy

§

impl RefUnwindSafe for Energy

§

impl Send for Energy

§

impl Sync for Energy

§

impl Unpin for Energy

§

impl UnwindSafe for Energy

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