Skip to main content

WorkFlow

Enum WorkFlow 

Source
pub enum WorkFlow {
    In(Constrained<Power, StrictlyPositive>),
    Out(Constrained<Power, StrictlyPositive>),
    None,
}
Expand description

Represents work flow across a system boundary.

This enum represents flow direction relative to the system:

  • In: Work flows into the system (positive contribution, work done on the system).
  • Out: Work flows out of the system (negative contribution, work done by the system).
  • None: No work flow occurs.

Note: Some thermodynamic texts define work as positive when done by the system (i.e., flowing out). This crate uses the opposite convention: positive = into the system, for consistency with HeatFlow and MassFlow sign conventions.

Variants§

§

In(Constrained<Power, StrictlyPositive>)

Work flowing into the system.

§

Out(Constrained<Power, StrictlyPositive>)

Work flowing out of the system.

§

None

No work flow occurs.

Implementations§

Source§

impl WorkFlow

Source

pub fn incoming(work_rate: Power) -> Result<Self, ConstraintError>

Creates a WorkFlow::In representing work flowing into the system.

§Errors

Returns a ConstraintError if work_rate is not strictly positive.

Source

pub fn outgoing(work_rate: Power) -> Result<Self, ConstraintError>

Creates a WorkFlow::Out representing work flowing out of the system.

§Errors

Returns a ConstraintError if work_rate is not strictly positive.

Source

pub fn from_signed(work_rate: Power) -> Result<Self, ConstraintError>

Creates a WorkFlow from a signed work flow rate.

  • Positive values indicate work flowing into the system.
  • Negative values indicate work flowing out of the system.
  • Zero indicates no work flow.
§Errors

Returns a ConstraintError::NotANumber if the value is not finite.

Source

pub fn signed(&self) -> Power

Returns the signed work flow rate.

  • Positive for work flowing into the system.
  • Negative for work flowing out of the system.
  • Zero if no work flow.

Trait Implementations§

Source§

impl Clone for WorkFlow

Source§

fn clone(&self) -> WorkFlow

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 WorkFlow

Source§

impl Debug for WorkFlow

Source§

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

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

impl PartialEq for WorkFlow

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for WorkFlow

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> Same for T

Source§

type Output = T

Should always be Self
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.